Re: parsing Unix date
Re: parsing Unix date
- Subject: Re: parsing Unix date
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 09 Jan 2004 12:13:06 -0800
On 1/9/04 10:59 AM, "Graff" <email@hidden> wrote:
>
Well, the easiest way is to simply format the date string in a way
>
AppleScript can parse easily:
>
----------
>
set d to (do shell script "date '+%A, %B %e, %Y %T'")
>
---> "Friday, January 9, 2004 13:07:10"
>
date d
>
---> date "Friday, January 9, 2004 1:07:10 PM"
>
----------
That's not necessary. AppleScript is tremendously versatile about
understanding dates (almost too versatile). As long as you include all the
info you need (day, month, year, hours, minutes, seconds as desired) you can
omit weekday, for example. You might want to weight up the advantages and
disadvantages of using month as string (where the localization will have to
be the same as in System Prefs) or as number (where you'll have to use the
same month-day-year order as in System Prefs). Unfortunately, the Unix codes
for localized month-day order (%E, ETC.) don't work in OS X - you always get
US version.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.