TimeZone

From ThorxWiki
(Difference between revisions)
Jump to: navigation, search
m (2 revision(s))
(reclarify, better script now I know about zdump ;))
Line 1: Line 1:
 
Because people keep thinking that the "EST" in my `date` command must be incorrect...
 
Because people keep thinking that the "EST" in my `date` command must be incorrect...
   
#!/bin/bash
+
Please run the following command (should be fine in linux, under solaris change the path to search under to /usr/share/lib/zoneinfo)
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
+
find /usr/share/zoneinfo -type f | xargs /usr/sbin/zdump | grep EST
   
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 :(
+
Now try it without the grep, and note the time zone identifiers, ...these are '''incorrectly assumed by most people to be unique'''. I believe (without references) that the timezone acronyms are based on local names - there is no global cooperation in keeping the namespace clean.

Revision as of 11:37, 15 January 2008

Because people keep thinking that the "EST" in my `date` command must be incorrect...

Please run the following command (should be fine in linux, under solaris change the path to search under to /usr/share/lib/zoneinfo)

find /usr/share/zoneinfo -type f | xargs /usr/sbin/zdump | grep EST

Now try it without the grep, and note the time zone identifiers, ...these are incorrectly assumed by most people to be unique. I believe (without references) that the timezone acronyms are based on local names - there is no global cooperation in keeping the namespace clean.

Personal tools
Namespaces

Variants
Actions
Navigation
meta navigation
More thorx
Tools