Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 4 - Date, Time, and Measurement Utilities / Date, Time, and Measurement Utilities Reference
Routines / Getting the Current Date and Time


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
The ReadDateTime function copies the current date-time information from the clock chip into low memory. It then returns in the time 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 the clkRdErr result code. The operation might fail if the clock chip is damaged. Otherwise, the function returns the noErr 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
A0Pointer to long word
Registers on exit
A0Pointer to current time
D0Result code

RESULT CODES
noErr0No error
clkRdErr-85Unable to read clock

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice