Re: Date math problem in Leopard
Re: Date math problem in Leopard
- Subject: Re: Date math problem in Leopard
- From: Jeff Jungblut <email@hidden>
- Date: Sat, 15 Mar 2008 09:23:52 -0700
- Thread-topic: Date math problem in Leopard
Thanks Chris. I look forward to the update being shipped in 2038.
:)
Jeff
on 3/14/08 7:46 PM, Christopher Nebel at email@hidden wrote:
> 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
> AppleScript Engineering
>
> On Mar 14, 2008, at 5:55 PM, Mark J. Reed wrote:
>
>> This looks like the float conversion issue again - 1056 weeks is more
>> than 2^30 seconds - but I don't know why it would work under Tiger and
>> not Leopard.
>>
>> On 3/14/08, Jeff Jungblut <email@hidden> wrote:
>>> I have a script that's been working for years in Tiger, but in
>>> Leopard it
>>> gives incorrect results. It calculates the date for a weekly
>>> magazine issue
>>> based on the issue number and the date of the first issue, so it
>>> can tell
>>> Quark to update the date in all the master pages of the docs that
>>> make up
>>> the magazine. Here's part of the code:
>>>
>>> set firstIssue to date "Thursday, December 24, 1987 12:00:00
>>> AM"
>>> set newDate to firstIssue + ((newIssue) * weeks)
>>> log newIssue -- value is 1056 to be published Mar. 20, 2008
>>> log (newDate as text)
>>>
>>> Correct results under Tiger:
>>>
>>> 2008-03-14 15:30:26.952 IssueDater[356] "1056"
>>> 2008-03-14 15:30:26.953 IssueDater[356] "Thursday, March 20, 2008
>>> 12:00:00
>>> AM"
>>>
>>> Results under Leopard (note each run produces a different result
>>> for the
>>> time component):
>>>
>>> 2008-03-14 15:36:16.300 IssueDater [222:10b] "1056"
>>> 2008-03-14 15:36:16.305 IssueDater [222:10b] "Tuesday, January 5,
>>> 1988
>>> 10:45:39 PM"
>>> 2008-03-14 15:36:31.503 IssueDater [222:10b] "1056"
>>> 2008-03-14 15:36:31.515 IssueDater [222:10b] "Tuesday, January 5,
>>> 1988
>>> 10:35:17 PM"
>>> 2008-03-14 15:36:39.170 IssueDater [222:10b] "1056"
>>> 2008-03-14 15:36:39.188 IssueDater [222:10b] "Tuesday, January 5,
>>> 1988
>>> 10:25:03 PM"
>>> 2008-03-14 15:36:43.167 IssueDater [222:10b] "1056"
>>> 2008-03-14 15:36:43.168 IssueDater [222:10b] "Tuesday, January 5,
>>> 1988
>>> 10:14:49 PM"
>>> 2008-03-14 15:36:44.763 IssueDater [222:10b] "1056"
>>> 2008-03-14 15:36:44.765 IssueDater [222:10b] "Tuesday, January 5,
>>> 1988
>>> 10:45:21 PM"
>>> 2008-03-14 15:36:46.503 IssueDater [222:10b] "1056"
>>> 2008-03-14 15:36:46.505 IssueDater [222:10b] "Tuesday, January 5,
>>> 1988
>>> 10:35:07 PM"
>>>
>>> Is this a bug in AppleScript under Leopard or has the date object
>>> changed in
>>> some way to break my script? Is there a workaround? Thanks for
>>> any help.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> net
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
--
Jeff Jungblut
email@hidden
Senior Graphic Designer & Web Developer
Uptown Publications
_______________________________________________
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