Ethereal-dev: Re: [Ethereal-dev] viewing captures from different timezones

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gilbert Ramirez <gram@xxxxxxxxxxxxxxx>
Date: Tue, 15 Jan 2002 11:38:00 -0600
On Tue, 15 Jan 2002 10:08:23 Jason House wrote:
> localtime() converts GMT time to the local timezone.  I have capture
> files from another timezone and currently either subtract 3 hours to get
> the (true) local day/time or add 4 hours to get GMT.
> 
> What is the recommended way to cleanly handle this kind of situation
> (ie. not simply requiring the user to change the time on his/her
> machine).  I can forsee a simple option to show GMT, but I don't know
> the proper way to handle "other timezones."

In Unix, the standard way is to set and export your TZ environment
variable before starting  your new process (Ethereal).

For example, I do work on a computer in California, but I am
physically located in Texas. I prefer to see all the times
relative to *me*, so I set TZ=CST6CDT. Then when I "ls -l", the
times shown are in *my* timezone, instead of the computer's timezone.

You could set TZ to the appropriate value before starting
Ethereal, so that localtime() chooses the correct idea of "local".

--gilbert