• 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: Time anomaly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time anomaly


  • Subject: Re: Time anomaly
  • From: Michelle Steiner <email@hidden>
  • Date: Sun, 28 Oct 2012 09:08:28 -0700

On Oct 28, 2012, at 8:29 AM, Thomas Fischer wrote:

I have to agree with Miguel, at least on my Snow Leopard system.
Calculations with months (or years) don't work as they do with days and weeks:

set myDate to the current date
set newDate to myDate + (371 * days)
log newDate
set newDate to myDate + (53 * weeks)
log newDate
set newDate to myDate + (12 * months)
log newDate
set newDate to myDate + (1 * year)
log newDate

works for days and weeks, but not for months  (actually already indicated by the colouring) and year (years is not a recognised term).
So I suppose it's some sort of bug in the date calculation part of AppleScript.

"days" is a constant equal to 86400, which is the number of seconds in a day.  "Day" is not used in this because it has another definition. (E.g., "day of (current date)")

Similarly "weeks" is a constant equal to 604800, the number of seconds in a week.

However, because the number of days in a month is not a constant, the number of seconds in a month can't be a constant, so "months" can't be a constant.  Similarly because the number of days in a year isn't a constant, "year" or "years" can't be a constant.

-- Michelle

-- 
I am woman; watch me vote.

 _______________________________________________
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: Time anomaly
      • From: Doug McNutt <email@hidden>
    • Re: Time anomaly
      • From: Jon Pugh <email@hidden>
References: 
 >Re: Time anomaly (From: Miguel Torikachvili <email@hidden>)
 >Re: Time anomaly (From: Ron Hunsinger <email@hidden>)
 >Re: Time anomaly (From: Thomas Fischer <email@hidden>)

  • Prev by Date: Re: Time anomaly
  • Next by Date: Re: Time anomaly
  • Previous by thread: Re: Time anomaly
  • Next by thread: Re: Time anomaly
  • Index(es):
    • Date
    • Thread