Carbon


SetTime

Header: DateTimeUtils.h Carbon status: Supported

Changes the date-time information in the clock chip to the specified value, expressed as a date and time.

void SetTime (
    const DateTimeRec *d
);
Parameter descriptions
d

The date and time to which to set the clock chip.

DISCUSSION

The SetTime function first converts the date and time to the number of seconds elapsed since midnight, January 1, 1904 by calling the DateToSeconds function. It then writes these seconds to the clock chip and to the system global variable Time by calling the SetDateTime function.

The SetTime function does not return a result code. If you need to know whether an attempt to change the date and time information in the clock chip is successful, you must use the SetDateTime function.

As an alternative to using the SetTime procedure, you can use the DateToSeconds and SetDateTime functions.

Users can change the current date and time stored in both the system global variable Time and in the clock chip by using the General Controls control panel, Date & Time control panel, or the Alarm Clock desk accessory. In general, your application should not directly change the current date-time information. If your application does need to modify the current date-time information, it should instruct the user how to change the date and time.

See DateTimeRec for a description of the fields of a date-time record

AVAILABILITY

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)