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.
GetTime Procedure
◄Summary► ◄Details► ◄Example► ◄Back►
Argument
hours Word variable receiving hours in range 0..23
minutes Word variable receiving minutes in range 0..59
seconds Word variable receiving seconds in range 0..59
hundredths Word variable receiving hundredths of second in
range 0..99
Description
The GetTime procedure returns the current time kept by the
operating system. GetTime works the same as the DOS command TIME
when TIME is used to return the system time.
The system time remains set until changed by rebooting, calling the
SetTime procedure, or executing TIME. Neither SetTime nor TIME
changes the time kept by a computer's hardware clock.
The arguments receive the parts of the current setting for time in
hours, minutes, seconds, and hundredths of a second.
GetTime returns information only as accurate as the time kept by
the system. For the system time to be correct, either the system
must have an accurate hardware clock or the correct date and time
must be set after every power-up.
Regardless of the hardware, the accuracy of PC clocks is less than
perfect, varying around one-quarter second. Therefore, the value
returned in the hundredths argument is unlikely to be accurate.