Re: Date math problem in Leopard
Re: Date math problem in Leopard
- Subject: Re: Date math problem in Leopard
- From: KOENIG Yvan <email@hidden>
- Date: Sat, 15 Mar 2008 10:46:39 +0100
Le 15 mars 2008 à 03:46, Christopher Nebel a écrit :
Uh, because Leopard has the conversion bug and Tiger doesn't? It's
a known problem -- adding more than 2^30 seconds to a date will
give a bogus result. We have a fix, but don't ask me when it'll
ship, because I can't tell you.
--Chris Nebel
OK
But why is it always wrong with this modified code?
set newIssue to 1056
set firstIssue to date "jeudi 24 décembre 1987 12:00:0"
if (newIssue * weeks) ≥ 2 ^ 30 then
set newDate to firstIssue + ((newIssue / 2) * weeks)
set newDate to newdatedate ((newIssue / 2) * weeks)
else
set newDate to firstIssue + ((newIssue) * weeks)
end if
log newIssue -- value is 1056 to be published Mar. 20, 2008
log (newDate as text)
This time we add
(3.193344E+8)
which is smaller than 2^30.
and I get jeudi 5 février 1998 … with the correct time value 12:00:0
while I wanted
jeudi 20 mars 2008 12:00:0
While I am on this area,
may we hope a fix for the number of seconds which is not formatted to
2 digits ?
Yvan KOENIG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden