Re: Time anomaly
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