in reply to How to convert time from one time zone to another
You can just set the TZ environment variable to the timezone you want, and use localtime:
The last time I ran it, this printed{ local $ENV{TZ} = "EST+05"; print "In New York, it is ".localtime()."\n"; } { local $ENV{TZ} = "IST-05:30"; print "In Mumbai, it is ".localtime()."\n" }
I think this will work on Windows as well as Unix, but I don't have a Windows box to test it on.In New York, it is Mon Dec 19 14:25:01 2005 In Mumbai, it is Tue Dec 20 00:55:01 2005
In Section
Seekers of Perl Wisdom