Re: Human Readable Time snipit
Re: Human Readable Time snipit
- Subject: Re: Human Readable Time snipit
- From: "Nigel Garvey" <email@hidden>
- Date: Sat, 14 Oct 2006 19:04:18 +0100
Martin Orpen wrote on Sat, 14 Oct 2006 11:55:24 +0100:
>Or, for a more "human readable" result you could the
>onCalendarInterval handler that Nigel posted in response to a problem
>that I was having working out the intervals between iCal events many E
>+ seconds ago:
>
>------------
>
>set startTime to date "Friday, January 1, 1904 00:00:00" -- trad Apple
>set finishTime to startTime + 5.86574625E+8
>
>set foo to calendarInterval(finishTime, startTime)
[snip]
>--> 18 yr 7 mth 2 dy 1 hr 23 min 45 sec
Unfortunately, the number of months and years depends on when you start.
The fixed intervals larger than a day are the week and the Gregorian
cycle. :)
on GwdhmsFormat(s)
(s div 1.26227808E+10 as string) & " Gr " & s mod 1.26227808E+10 div
weeks & " wk " & s mod weeks div days & " dy " & s mod days div hours & "
hr " & s mod hours div minutes & " min " & s mod minutes div 1 & " sec"
end GwdhmsFormat
GwdhmsFormat(5.86574625E+8)
--> "0 Gr 969 wk 6 dy 1 hr 23 min 45 sec"
NG
_______________________________________________
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