ReadDateTimeSystem software uses at system startup time the ReadDateTime function to copy the date-time information from the clock chip into low memory. Your application should never need to use this function.
FUNCTION ReadDateTime (VAR time: LongInt): OSErr;
- On return, the current time expressed as the number of seconds elapsed since midnight, January 1, 1904.
ReadDateTimefunction copies the current date-time information from the clock chip into low memory. It then returns in the
timeparameter a copy of the date-time information, expressed as the number of seconds elapsed since midnight, January 1, 1904.
The low-memory copy of the date and time information is accessible through the global variable
If the clock chip cannot be read,
clkRdErrresult code. The operation might fail if the clock chip is damaged. Otherwise, the function returns the
ASSEMBLY-LANGUAGE INFORMATIONYou must set up register A0 with a pointer to a long integer in which you wish to store the current date-time information. On exit, register A0 contains the same pointer to the now-changed long integer, and register D0 contains the result code.
The registers on entry and exit for this routine are
Registers on entry A0 Pointer to long word
Registers on exit A0 Pointer to current time D0 Result code
noErr 0 No error clkRdErr -85 Unable to read clock