Important: The information in this document is obsolete and should not be used for new development.
ReadDateTime
System 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;
time
- On return, the current time expressed as the number of seconds elapsed since midnight, January 1, 1904.
DESCRIPTION
TheReadDateTime
function copies the current date-time information from the clock chip into low memory. It then returns in thetime
parameter 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
Time
.If the clock chip cannot be read,
ReadDateTime
returns theclkRdErr
result code. The operation might fail if the clock chip is damaged. Otherwise, the function returns thenoErr
result code.ASSEMBLY-LANGUAGE INFORMATION
You 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 RESULT CODES
noErr 0 No error clkRdErr -85 Unable to read clock