Re: Getting human-understandable time from iCal
Re: Getting human-understandable time from iCal
- Subject: Re: Getting human-understandable time from iCal
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 28 Sep 2004 07:32:13 -0700
Title: Re: Getting human-understandable time from iCal
On 9/28/04 5:02 AM, "Martin Orpen" <email@hidden> wrote:
I'd like to be able to get the time between events in iCal in a more "readable" format.
I can easily get seconds between events:
tell application "iCal"
set t1 to start date of first event of calendar 9 whose summary is "xx01"
set t2 to start date of first event of calendar 9 whose summary is "xx02"
set t3 to t2 - t1
end tell
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...
'Month' is not a precise amount. You could write a handler checking month names and/or indices (month as integer works in Panther which would simplify it slightly) and compensating (add extra year) when the later month index is smaller than the earlier one. Then you have to go through the same thing for days of the months, also checking for Feb 29 that year, etc. It's tedious, but it could be done.
(Expecting iCal to have any date sophisticated features is a bit of a laugh. iCal can't even manage all-day events without setting the start date as if you were in GMT and then falling over itself making a second error in trying to regularize it, so you can end up with a date that's either two days or one day out.)
--
Paul Berkowitz
_______________________________________________
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