TZ variable and DH settings


#1

Can someone explain to me why this happens:

[yen]$ date
Fri Oct 27 00:51:29 PDT 2006
[yen]$ export TZ=EDT
[yen]$ date
Fri Oct 27 07:51:39 EDT 2006

I was expecting to see Fri Oct 27 03:51:39 EDT 2006 in the last line since Eastern Daylight Time is 3 hours ahead of Pacific Daylight Time (ie where the servers are). How’d I end up with 7 hours difference?


#2

Because the default timezone is GMT…


#3

Because “EDT” isn’t one of the POSIX compatible timezones.
Do a “tzselect” for assistance in selecting the correct time zone abbreviation.


#4

Thanks, the tzselect thing was very helpful.

Just curious – any idea why ‘date’ would give incorrect results instead of an error if it didn’t recognize the TZ value I’d set? Why did it add 7 hours to the server’s PDT time?


#5

Possibly due to the fact the posix timezones tend to use ISO 3166 as a basic formation of standard, the “EST” abbreviation is somehow mistaken as “Estonia”. Just a guess, mind ya. Also not the sort of boggle that keeps me awake nights, but if ya really must know ya can always Google for “posix timezone” and surf a few results.

ObGeek: It’s not “incorrect results”, it’s “unpredictable results”.

/yes, there is such a place as Estonia
//despite of what you may’ve heard from Pauly Shore.