• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Date math problem in Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date math problem in Leopard


  • Subject: Re: Date math problem in Leopard
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 14 Mar 2008 19:46:32 -0700

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:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Date math problem in Leopard
      • From: Jeff Jungblut <email@hidden>
    • Re: Date math problem in Leopard
      • From: "Mark J. Reed" <email@hidden>
    • Re: Date math problem in Leopard
      • From: KOENIG Yvan <email@hidden>
    • Re: Date math problem in Leopard
      • From: Michelle Steiner <email@hidden>
References: 
 >Date math problem in Leopard (From: Jeff Jungblut <email@hidden>)
 >Re: Date math problem in Leopard (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: File best practice questions
  • Next by Date: Re: File best practice questions
  • Previous by thread: Re: Date math problem in Leopard
  • Next by thread: Re: Date math problem in Leopard
  • Index(es):
    • Date
    • Thread