Re: Getting human-understandable time from iCal
Re: Getting human-understandable time from iCal
- Subject: Re: Getting human-understandable time from iCal
- From: Doug McNutt <email@hidden>
- Date: Tue, 28 Sep 2004 07:07:02 -0600
At 13:02 +0100 9/28/04, Martin Orpen wrote:
>Can iCal be scripted to return years/months/days/hours/minutes/seconds?
>
>I've no problem divving and modding to get days/hours etc - but I need an accurate month count too and presume that iCal, being a calendar....
An accurate, scientific, answer will forever remain NO except for things in the past. The truth is that the number of seconds in a day or year is not an integer and it changes over time. Leap years and leap seconds are a fact of life.
There have been several discussions over in the Microsoft Excel mailing lists about calculating a person's age in years from the time codes Excel uses which are floating point days since 1904 (for the Mac). Even with all of the fairly good time and date functions that Excel offers it all comes down to defining what you really mean by "age". When you try for that month count you'll get all fuzzed up with leap years.
There are nearly pi * 1e7 seconds in a year. How about dividing the difference in time codes by that and again by 12 to get the approximate months?
--
--> There are 10 kinds of people: those who understand binary, and those who don't <--
_______________________________________________
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