TimeZone
From ThorxWiki
(Difference between revisions)
(first writeup) |
m (2 revision(s)) |
Revision as of 02:04, 25 October 2007
Because people keep thinking that the "EST" in my `date` command must be incorrect...
#!/bin/bash function dotz () { while read i ; do export TZ=$(echo $i | awk -F' ' '{print $3}') OFFSET=$(date +%z) TLA=$(date +%Z) echo -e "$OFFSET\t$TLA\t$TZ" >> foo done } grep -v "^#" /usr/share/zoneinfo/zone.tab > tz.list dotz < tz.list sort -k2 foo > timezones
See results at http://www.cheeky.house.cx/~nemo/extras/timezones
First columns is time offset, third column is the $TZ environment variable. The Second column is the time zone identifier, incorrectly assumed by most people to be unique. I can't find an RFC on it though :(