Tim Commonwealth Games Time Zone page

Tim commonwealth games Time Zone page

This program will test your Unix based system to see if it has the correct timezone files.

If your time zone isn't set properly, you may need to set it with:
$ TZ=Australia/Melbourne
$ export TZ
and then run the program.

I call this program 'tz':

#!/usr/bin/perl
print "Timezone is '$ENV{TZ}'\n";

$basetime=1143082705;

print scalar localtime($basetime),"\n";
print scalar localtime($basetime+7*24*3600),"\n";
print scalar localtime($basetime+14*24*3600),"\n";

if (scalar localtime($basetime+7*24*3600) ne "Thu Mar 30 13:58:25 2006") {
	print "Timezone data is broken broken\n";
	print "get updates from ftp://elsie.nci.nih.gov/pub/\n";
	print "run as root: # zic australasia\n";
	print "also note that names are now Australia/Melbourne not\n";
	print "Australia/Victoria so you may need to copy them\n";
	print "The timezone files tend to be in /usr/share/zoneinfo/ or\n";
	print "/usr/share/lib/zoneinfo/\n";
} else {
	print "Timezone data is fixed for commonwealth games\n";
}




Back to Tim's Homepage Back to current subject Related Links thogard@abnormal.com
 This page was last updated Thursday, 23-Mar-2006 03:38:13 UTC Copyright 2000-2017 thogard™ is a trademark of Tim Hogard