Re: Getting the time zone
Re: Getting the time zone
- Subject: Re: Getting the time zone
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 13 Dec 2007 20:22:10 -0500
On Dec 13, 2007 8:09 PM, Rob Lewis <
email@hidden> wrote:
How can you get the computer's time zone setting in a script?
Good question, since IIRC, pre-OS-X the Mac OS didn't have a concept of time zone.
Also, I've seen a date/time format in XMP metadata like this:
2007-12-14T17:55:38-08:00
Where the letter "T" seems to separate the date from the time, and
the time zone offset is tacked onto the end.
Is this a standard format?
Yes. Specifically, part of ISO 8601.
Is it directly supported in AppleScript?
AppleScript just uses whatever you have set in your preference pane. You can certainly set things up to display dates in that format, in which case AS's conversion to strings will honor that setting.
Shell script?
The format string used by the strftme library routine, and therefore the "date" command, has shortcuts for the components:
date +%FT%T%z
Where %F is equivalent to %Y-%m-%d and %T is equivalent to %H:%M:%S, and %z is the timezone offset.
--
Mark J. Reed <
email@hidden
>
_______________________________________________
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