GetDateTime
GetDateTime Obtain "raw seconds" value of Time variable #include <OSUtils.h> Operating System Utilities
GetDateTime obtains the "raw" seconds value, as known to the system. secs is the address of a 4-byte variable. Upon return, it contains the
number of seconds since Midnight, January 1, 1904 (as read from
the real-time clock hardware at startup and updated periodically by
(at 0x020C) and into the specified variable. Thus, the following are
functionally equivalent:
GetDateTime( &secs); [TOKEN:12074] is the same as . . . */ secs = Time;
It is recommended that you obtain the value using the GetDateTime trap rather than using the low-memory variable however, as it is possible that
low-memory variables may change in the future.
You can convert the secs value to a more understandable value (i.e., a
since it is possible for the Time variable to lose seconds when interrupts get disabled for very long.
Since the base date for the "raw seconds" value is 1/1/1904 and since secs
is a 32-bit value, you won't be able to calculate with dates beyond February
6, 2040.