• 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: A few questions about dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few questions about dates


  • Subject: Re: A few questions about dates
  • From: kai <email@hidden>
  • Date: Sun, 27 Aug 2006 03:27:21 +0100


On 27 Aug 2006, at 03:07, Michelle Steiner wrote:

set today to (current date)

I then use it for various forms of date comparisons. The reason I do this is that current date returns the date, exact to the second, each time it is called, so if you call it more than once in a script, it may give different results each time.

It's also more efficient to make just that one external call.

set x to "july 4, 1776"
set y to "July 4, 2006"
set z to (current date) - (date x)
(z / days) / 365.24

--> 230.14674077826

But that is some 53 days off; when did the US move from the Julian calendar to the Gregorian? And how many days difference did that cause?

set x to "july 4, 1776" set y to "July 4, 2006" set z to (date y) - (date x) z mod (days * 365.24) / days --> 365.04

:-)

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: A few questions about dates
      • From: Michelle Steiner <email@hidden>
References: 
 >A few questions about dates (From: Sweth Chandramouli <email@hidden>)
 >Re: A few questions about dates (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: A few questions about dates
  • Next by Date: Re: A few questions about dates
  • Previous by thread: Re: A few questions about dates
  • Next by thread: Re: A few questions about dates
  • Index(es):
    • Date
    • Thread