[futurebasic] Re: [FB] [XFB] SANE comp sending me INSANE

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2002 : Group Archive : Group : All Groups

From: Heather Donahue <maclists@...>
Date: Wed, 06 Nov 2002 13:40:37 -0800
On 11/6/02 4:02 AM, "Ashley Butterworth" <macbse@...> wrote:

>> The time is based on seconds from 12:00:00 1/1/1904 which is a
>> LongDateTime of zero  The first 32 bits give you a date around 2040
>> 
> 
>  The lower 32bits can be directly set from the UInt32 available from
> any of the other Mac Time functions but this won't work beyond the year
> 2040. But I will need my program to keep functioning with dates beyond
> 40 years from now for long range predictions

The Mac functions can work with dates beyond that, I just don't remember the
total range.  Cross-platform is the problem though isn't it?

Even on the Mac time is a problem.  The Carbon-based functions allow setting
times far beyond 2040.  The core BSD is limited to the UNIX 32-bit C
standard (?2038).  So on OS X you have two API's you can use, one 64-bit the
other 32-bit.

Some UNIX/Linux variants are supporting 64-bit time, later versions of
Windows are as well.  So some OS's that you'd want to write for will support
64-bit time, they just aren't all compatible.
 
>> The sign, the high bit of the second 32 bits, allows dates before 12:00:00
>> 1/1/1904  If you were to use the full 64 bits, you'd have a range of many
>> billions of years.
>
>  500 billion years actually.

I know, I just didn't want to be pedantic :-)

Rather than write a program to test this, I used Resorcerer's Value
Converter:

Maximum Mac Date:

Signed Wide            Hex                          Date/Time
884763262975   0x000000CDFFFFFFFF   Saturday, January 11, 29941 1:02:55 PM

Minimum Mac Date:

Signed Wide            Hex                          Date/Time
-60147446400   0xFFFFFFF1FEEECD80   Thursday, January 1, 0003 12:00:00 AM

I can't seem to get any dates beyond the maximum or before the minimum.
While the signed 64-bit time _can_ range 500 billion years, I don't think
the OS can do it.

Now I am being pedantic.