Re: date format
Re: date format
- Subject: Re: date format
- From: Nigel Garvey <email@hidden>
- Date: Wed, 28 Nov 2001 09:04:11 +0000
ehsan saffari wrote on Tue, 27 Nov 2001 23:38:48 -0600:
>
On 27/11/2001 23:10, Jan Erik Mostrvm <email@hidden> wrote:
>
>
>I usually use something like this
>
>
>
>on makeFormattedDate(ftype, currentDate)
>
> copy currentDate to b
>
> set month of b to January
>
<snip>
>
>
Dang! I just found one flaw with the French Vanilla,
>
it chokes on dates before Jan 1, 1904.
>
>
set x to 1 + ((currentDate - b + 1314864) div 2629728)
>
--> The result of a numeric operation was too large.
Wow! This isn't a flaw with French Vanilla so much as a problem with
AppleScript's date arithmetic. The result shouldn't be any greater than
with the years that do work, so there must be some internal problem
during the subtraction - prossibly involving register sizes and sign
bits. If either one of the dates involved in a subtraction is or comes
after 1/1/1904 then the problem disappears.
A work-round for French Vanilla would be an extra line at the beginning:
set year of currentDate to 1904
copy current date to b
set month of b to January
-- etc.