[comp.sys.mac.programmer] Stuffit time-stamp

david.dmytryshyn@f428.n250.z1.fidonet.org (david dmytryshyn) (07/31/89)

Need some help...  Working on a Stuffit viewer on MSDOS machine, and can't
quite figure out how dates are encoded into the 32 bit numbers on a macintosh 
file.  I'm looking for examples converting to numbers and back again.


Thanks..


David..

--- FD 2.00
 * Origin: Synaptic Communications (1:250/428)

beard@ux1 (Patrick C Beard) (08/12/89)

In article <89073016521584@masnet.uucp> david.dmytryshyn@f428.n250.z1.fidonet.org (david dmytryshyn) writes:
>
>Need some help...  Working on a Stuffit viewer on MSDOS machine, and can't
>quite figure out how dates are encoded into the 32 bit numbers on a macintosh 
>file.  I'm looking for examples converting to numbers and back again.
>

From Inside Macintosh, Volume II, pg. 369:

"It's stored as a number of seconds since midnight, January 1, 1904, and
is updated every second."

Conversion routines are simple, just keep track of leap years and days
of the week.  If you need more, I'm sure somebody is waiting in the wings
with a suitable routine (although routines are in the Mac ROM to do it 
for Mac programmers).


-------------------------------------------------------------------------------
-  Patrick Beard, Macintosh Programmer                        (beard@lbl.gov) -
-  Berkeley Systems, Inc.  ".......<dead air>.......Good day!" - Paul Harvey  -
-------------------------------------------------------------------------------