Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: A few questions about dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few questions about dates



On Aug 26, 2006, at 5:28 PM, Sweth Chandramouli wrote:

3) What's the deal with "today"? It seems to be a synonym for "current
date" when used in comparisons, but doesn't seem to be valid anywhere
else.

I use today as a variable for current date; i.e.,

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.

As others have mentioned, the date in seconds depends on the epoch used.

I'm not sure, but I think that the Jan 1, 1904 beginning date of the Mac's epoch was done away with in OS X.

set x to "july 4, 1776"
(date x)

--> date "Thursday, July 4, 1776 12:00:0 AM"

set x to "july 4, 1776"
(current date) - (date x)

--> 7.262679661E+9

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?

-- Michelle

--
"You can fool some of the people all of the time and those are the ones you want to concentrate on."
- George W. Bush at the Gridiron Dinner, Washington, DC March 31, 2001


_______________________________________________
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


References: 
 >A few questions about dates (From: Sweth Chandramouli <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.