![]() |
GetTime |
||||
Header: | DateTimeUtils.h | Carbon status: | Supported | |
Obtains the current date-time information, expressed as a date and time.
void GetTime ( DateTimeRec *d );
On return, the fields of the date-time structure contain the current date and time.
The GetTime function first calls the GetDateTime function to obtain the number of seconds elapsed since midnight, January 1, 1904. It then calls the SecondsToDate function to convert the number of seconds into a date and time.
As an alternative to using the GetTime procedure, you can pass the value of the global variable Time to the SecondsToDate function; a SecondsToDate(Time) function call is identical to a GetTime(d) function call.
If an application disables interrupts for longer than a second, the date-time information returned by the GetTime function might not be exact. The GetTime function is intended to provide fairly accurate time information, but not scientifically precise data.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)