• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Epoch Seconds to YYYY-MM-DD
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Epoch Seconds to YYYY-MM-DD
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: Epoch Seconds to YYYY-MM-DD
  • Next by Date: Re: Epoch Seconds to YYYY-MM-DD
  • Previous by thread: Re: Epoch Seconds to YYYY-MM-DD
  • Next by thread: Re: Epoch Seconds to YYYY-MM-DD
  • Index(es):
    • Date
    • Thread