Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

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 / Converting Between Date-Time Formats


DateToSeconds

You can use the DateToSeconds procedure to convert a date and time to a number of seconds elapsed since midnight, January 1, 1904.

PROCEDURE DateToSeconds (d: DateTimeRec; VAR s: LongInt);
d
The date-time record containing the date and time to convert.
s
On return, the number of seconds elapsed between midnight, January 1, 1904, and the time specified in the d parameter.
DESCRIPTION
The DateToSeconds procedure converts the date and time specified in the d parameter to the number of seconds elapsed since midnight, January 1, 1904. The number of seconds are returned in the s parameter. For example, specifying a date and time of 5:50 A.M. on June 13, 1990 results in 41627 being returned in the s parameter.

The DateToSeconds procedure is also available as the Date2Secs procedure.

ASSEMBLY-LANGUAGE INFORMATION
You must set up register A0 with a pointer to the date and time record containing the date and time you wish to convert. When DateToSeconds returns, register D0 contains a long integer representing the converted date and time.

The registers on entry and exit for this routine are
Registers on entry
A0Pointer to date-time record
Registers on exit
D0Corresponding seconds since midnight, January 1, 1904

SEE ALSO
For a complete description of the date-time record, see page 4-23.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996