Re: time formatting
Re: time formatting
- Subject: Re: time formatting
- From: "Nigel Garvey" <email@hidden>
- Date: Fri, 29 Jun 2007 00:16:24 +0100
cheshirekat wrote on Thu, 28 Jun 2007 14:25:10 -0600:
>I am pulling events from a specific iCal calendar to a text document for
>my iPod. When done, I have events that have strings of
>
> Wednesday 6/27/07 from 11:00:00 AM to 4:00:00 PM
>
>I would like to have universal times of
>
> Wednesday 6/27/07 from 1100 to 1600
>
>Here is the relevant part of the script:
Hi, cheshirekat.
The four lines inserted below give the results you want fairly economically.
>repeat with ev in eventTargets
> set the evProps to the ev's properties
> set the evStartDate to (the short date string of (the
>evProps's start date))
> set the evDay to word 1 of (the date string of (the
>evProps's start date))
set t to (the time of (the evProps's start date))
set the evStartTime to text 2 thru 5 of ((10000 + t div
hours * 100 + t mod hours div minutes) as string)
set t to (the time of (the evProps's end date))
set the evEndTime to text 2 thru 5 of ((10000 + t div
hours * 100 + t mod hours div minutes) as string)
> -- sp = " ", ret = return
> set the evData to evDay & sp & evStartDate & " from " &
>evStartTime & " to " & evEndTime & ret
> set the gardenEvents to (the gardenEvents & the evData)
>end repeat
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden