Re: Epoch Seconds to YYYY-MM-DD
Re: Epoch Seconds to YYYY-MM-DD
- Subject: Re: Epoch Seconds to YYYY-MM-DD
- From: Nigel Garvey <email@hidden>
- Date: Tue, 30 Apr 2013 00:22:50 +0100
Deivy Petrescu wrote on Mon, 29 Apr 2013 11:55:22 -0400:
>> Or this hack still works in Snow Leopard!:
>>
>> set today to (current date)
>> set theDates to {}
>> repeat with X from 0 to 28
>> set end of theDates to text 1 thru 10 of ((today - X * days) as
«class
>>isot» as string) -- NB. 'as string', not 'as text'.
>> end repeat
>>
>> return theDates
>>
>>
>> NG
>>
>Nigel,
>It works in ML as well.
Thanks, Deivy.
The reverse process ("yyyy-mm-dd" as «class isot» as date) no longer
works, but can be got round (again, in Snow Leopard) with more hackery:
set isot to "2013-04-29"
(do shell script "echo \"" & isot & "\"" as «class isot») as date
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