|
From: Rob T. <ro...@ts...> - 2001-04-03 17:11:40
|
on 4/3/01 9:56 AM, Ben Hines at bh...@al... wrote:
> Well, we need to convert a time_t to a LongDateTime. I thought they
> were both just seconds (time_t from unix epoch, longdatetime from mac
> epoch) but when i tried the conversion it didnt work. Rifkin knows
> more about this than me.
Below is what Inside Mac says about LongDateTime. Does that help? What went
wrong with the conversion?
LONG DATE-TIME VALUE AND LONG DATE-TIME CONVERSION RECORD
The long date-time value specifies the date and time as seconds relative to
midnight, January 1, 1904. But where the standard date-time value is an
unsigned, 32-bit long integer, the long date-time value is a signed, 64-bit
integer in SANE comp format. This format lets you use dates and times with =
a
much longer span=8Broughly 500 billion years. You can use this value to
represent dates and times prior to midnight, January 1, 1904. The
LongDateTime data type defines the long date-time value.
TYPE LongDateTime =3D comp;
When storing a long date-time value in files, you can use a 5-byte or 6-byt=
e
format for a range of roughly 35,000 years. You should sign extend this
value to restore it to a comp format.
The Date, Time, and Measurement Utilities provide the LongDateCvt record to
help in setting up LongDateTime values.
TYPE LongDateCvt=3D
RECORD
CASE Integer OF
0:
(c: comp); {number of seconds relative to }
{ midnight, January 1, 1904}
1:
(lHigh: LongInt; {high long integer}
lLow: LongInt); {low long integer}
END;
Field Descriptions
c The date and time, specified in seconds relative to midnight, January
1, 1904, as a signed, 64-bit integer in SANE comp format. The high-order bi=
t
of this field represents the sign of the 64-bit integer. Negative values
allow you to indicate dates and times prior to midnight, January 1, 1904.
lHigh The high-order 32 bits when converting from a standard date-time
value. Set this field to 0.
lLow The low-order 32 bits when converting from a standard date-time
value. Set this field to the standard date-time value representing the tota=
l
number of seconds since midnight, January 1, 1904.
|