[rescue] Timezone

Steve Sandau rescue at sunhelp.org
Tue Dec 25 18:18:13 CST 2001


I've seen an answer to this on the Internet before. The link here isn't
the method I've seen before, but it would appear to work. :)

http://unix.about.com/library/weekly/aa070901e.htm

ed at the7thbeer.com wrote:
> 
> 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
> _______________________________________________
> rescue maillist  -  rescue at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/rescue

-- 
Steve Sandau
ssandau at bath.tmac.com



More information about the rescue mailing list