in reply to Time zone of the system

Hi,

Check out Time::Timezone:
"tz2zone() parses the TZ environment variable and returns a timezone string suitable for inclusion in date-like output"

You may also want to look at The Perl DateTime Project .

Hope this helps.

Martin

Replies are listed 'Best First'.
Re^2: Time zone of the system
by Anonymous Monk on Sep 28, 2005 at 09:47 UTC
    The TZ environment variable isn't the same as the system time zone. Most (Unix) systems will have their system clock running on UTC - but have most processes use a different TZ (There aren't that many places that actually have UTC as their timezone - even the UK and Portugal use daylight saving and are hence not on UTC, which doesn't do daylight saving). And TZ can vary from process to process, or even switch during the lifetime of the process.

    I do not know a portable way to determing the system time zone. If /etc/adjtime exists, one might look at its third line, however, there's no garantee that line is actually correct.

    I've no idea whether Windows system typically use UTC or local time.