• 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: 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

  • Follow-Ups:
    • Re: Time anomaly
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: Time anomaly (From: Miguel Torikachvili <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