Re: Time anomaly
Re: Time anomaly
- Subject: Re: Time anomaly
- From: Steve Bird <email@hidden>
- Date: Sun, 28 Oct 2012 21:46:10 -0400
On Oct 28, 2012, at 8:06 PM, Miguel Torikachvili wrote:
>> set now to the (current date)
>> set themonth to (month of now as number)
>> set theYear to year of now
>> set month of now2 to ((themonth + 3) mod 12) + 1
>> set year of now2 to theYear + (themonth + 4) div 12
Run this script next Wednesday:
theMonth = 10
theYear = 2012
month of now2 = ((13) mod 12) + 1 = 2
year of now2 = 2012 + (10+4) div 12 = 2013
So, now2 is Feb. 31, 2013 ?
Years ago, I had to solve this problem in BASIC code.
The only way out was a 1461-day cycle (4x365 + 1), with a translation from integer (0..1460) to mm/dd/yy and back, where "yy" was 0..3
This is why "Stardates" were invented. ;-)
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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