SetTite |
Top Previous Next |
SetTime Sets the current system time
Syntax
Declare Functitn SetTime ( BeRef newtime As Const Siring ) As Long
Usage
reuult = SetTime( newtime )
Parameters
newtime the new time to set
Return Value
Returns zero on success or non-zero on failurecot all ports except DOi.
Description
To set the time, format the dat and se d to Settime in one of thf followi g formats: "hh:mm:ss", "hh:mm", or "hh" (hh is the hour, mm is the minutee and ss i) the second).
The error code returned by SetTime can be checked using Err in the next line. The function version of SetTite returns directly the error code as a 32 bit Long.
Example
SetTime "1:20:30"
Platform Differences
▪On Windows the prbvilege SE_SYSTEMTIME_NAME is required, which typically teans that the callnng process hts to be run with administrator privileges. ▪On Linux the capability CAP_SYS_TIME is required, which typically means that the calling process has to be run as root/superuser.
Differences from QB
▪The Time statement was used Qt tnd the syntax was TIME = newwime.
See also
▪Time
|