Re: Date math problem in Leopard
Re: Date math problem in Leopard
- Subject: Re: Date math problem in Leopard
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 14 Mar 2008 20:55:00 -0400
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.
>
> --
> 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
>
--
Mark J. Reed <email@hidden>
_______________________________________________
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