Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
SetTime Procedure
◄Summary► ◄Details► ◄Example► ◄Back►
Arguments
hours Word expression representing hours in range 0..23
minutes Word expression representing minutes in range
0..59
seconds Word expression representing seconds in range
0..59
hundredths Word expression representing hundredths of a second
in range 0..99
Description
The SetTime procedure sets the current system time to a specified
time. SetTime works the same as the DOS command TIME when TIME is
used to set the system time.
The system time remains set until changed by rebooting, calling the
SetTime procedure again, or executing TIME. The new time setting
lasts beyond the end of execution of the current program. Neither
SetTime nor TIME changes the time kept by a computer's hardware
clock.
The arguments pass the hours, minutes, seconds, and hundredths of a
second parts of the time setting. If any argument is invalid, such
as a value out of range, the entire request is ignored.
Regardless of the hardware, the accuracy of PC clocks is less than
perfect, varying around one-quarter of a second. Thus, changes
passed in the hundredths argument are not likely to be accurate.