in reply to Determining Time Zone on Win32

Try this module Time::Piece

This module replaces the standard localtime and gmtime functions with implementations that return objects. It does so in a backwards compatible manner, so that using localtime/gmtime in the way documented in perlfunc will still return what you expect

you can also able find time different

$t1 - $t2; # returns Time::Seconds object $t1 - 42; # returns Time::Piece object $t1 + 533; # returns Time::Piece object

Replies are listed 'Best First'.
Re^2: Determining Time Zone on Win32
by bsb (Priest) on May 10, 2006 at 07:01 UTC
    Time::Piece::tzoffset looks good, thanks
    perl -MTime::Piece -le '$m=localtime->tzoffset->minutes; printf "%+02. +2d%02.2d\n", int($m/60), $m%60' +1000 # cmd.exe friendly perl -MTime::Piece -le "$m=localtime->tzoffset->minutes; printf qq(%+0 +2.2d%02.2d\n), int($m/60), $m%60" +1000