[rescue] Timezone

rescue at sunhelp.org rescue at sunhelp.org
Tue Dec 25 13:45:01 CST 2001


Question --

In bourne shell, 'tis written that one may do:

$ TZ="TZ+24"
$ export TZ
$ date
 and the output of date will be the previous day.  My output is the day
before + 8 hours.  I presume this is because my TZ is Pacific.  But adding
24 + 8 for "TZ+32" yields today + 3 hours.  *headscratch*  Maybe I had too
much eggnog last night...

First, anyone know the best way to get the previous day(and the day
before) out of a shell construct and second, why do you add 24 hours to
the timezone to get the *previous* day?  My guess is that since timezones
increment towards the east, that subtracting, as in PST = GMT - 8hrs,
would get you to midnight of the same day and then back over  the
international date line, which would be the following day.  Is this even
close?  

Ah, the little puzzles my wife gives me for Christmas.  :)  

ed



More information about the rescue mailing list