timezone offset

Post Reply
aitchon
Posts: 118
Joined: Mon Jan 22, 2007 10:30 am

timezone offset

Post by aitchon »

I know date can be formatted to UTC by using %aT. Is there anyway to format a date to include the time zone offset (eg 2012-11-15T14:22:00-05:00)?
User avatar
John
Site Admin
Posts: 2597
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

timezone offset

Post by John »

Depending on your OS you may find:

<fmt %at "%Y-%m-%dT%H:%M:%S%z" $date>

will work.
John Turnbull
Thunderstone Software
User avatar
Kai
Site Admin
Posts: 1271
Joined: Tue Apr 25, 2000 1:27 pm

timezone offset

Post by Kai »

If the OS does not support `%z' then you might be able to use the internal time formatter by prepending a `|' (pipe) to the time format (i.e. before the `%Y'): the internal formatter (currently undocumented) usually supports `%z'.
Post Reply