Important: The information in this document is obsolete and should not be used for new development.
SetTime
You can use theSetTime
procedure to modify the date-time information in the clock chip. TheSetTime
requires that the new date-time information be passed to the function as a date and time.
PROCEDURE SetTime (d: DateTimeRec);
d
- The date and time to which to set the clock chip.
DESCRIPTION
TheSetTime
procedure writes the date and time specified by thed
parameter to the clock chip. TheSetTime
procedure first converts the date and time to the number of seconds elapsed since midnight, January 1, 1904 (by calling theDateToSeconds
procedure). It then writes these seconds to the clock chip and to the system global variableTime
(by calling theSetDateTime
function).As an alternative to using the
SetTime
procedure, you can use theDateToSeconds
andSetDateTime
routines.
- Note
- The
SetTime
procedure 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 theSetDateTime
function.SEE ALSO
See page 4-23 for a description of the fields of a date-time record. For more information on theDateToSeconds
procedure, see page 4-39. TheSetDateTime
function is described on page 4-36. For sample code that uses theSetTime
procedure to write date-time information (represented as a date and time) to the clock-chip, see Listing 4-4 on page 4-11.