Re: Very strange dates - BUG
Re: Very strange dates - BUG
- Subject: Re: Very strange dates - BUG
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 30 Jan 2003 13:24:17 -0800
On 1/30/03 9:29 AM, I wrote:
>
> Shouldn't AppleScript be able to do the same thing? Convert addition of a
>
> signed negative integer to subtraction of an unsigned integer (or signed
>
> positive integer, if that's what it's doing)?
>
>
Subtracting (or adding) unsigned integers is evidently a different matter
>
from adding (or subtracting) signed integers (integers with a + or - sign).
>
There are actually twice as many Unsigned integers as each type of signed
>
integer. I think that Apple time, based on seconds, must actually use signed
>
integers which "roll up" after they "roll down". In fact, that date I found
>
in January 1971 is approximately, but not exactly half way between between
>
the "dawn of time" - Jan 1, 1904 - and the "end of time" - Feb 5(?) 2040. I
>
wonder what accounts for the discrepancy.
My error: the date is Jan. 19, 1972, and that really is halfway between
1/1904 and Feb 5, 2040 (also the same 68 years + back from 1/1/1904 to the
late 1835 dates I was getting.) Chris Nebel tells me the the number is
" exactly 2^31
seconds away from the Mac epoch (aka time zero, 1/1/1904 0:00:00); the
problem has to do with a 64-bit math routine that doesn't correctly
handle overflow. The reason subtracting a positive number works is
that addition and subtraction use different code paths."
So not unsigned vs. signed integers. (I didn't test the reverse because my
reverse code just gets the date string of dates in Address Book and doesn't
need time to GMT for the bug there which sets birthdays to GMT.)
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.