This works fine if you want fractional hours. Email headers use this signed, 4-digit value as hours/minutes. So:
Kabul, Afghanistan: +0430 in an email time header. Stewart At 3:08 PM -0500 11/21/01, Chris Nandor wrote: >At 11:56 -0800 2001.11.21, John W Baxter wrote: >>At 8:26 -0500 11/21/2001, Chris Nandor wrote: >>>At 14:19 +0100 2001.11.21, Louis Pouzin wrote: >>>>The Mac Date & Time control panel keeps the time zone. e.g. Paris. >>>> >>>>Is there a way to grab this info, in MacPerl, or at least the difference >>>>from >>>>UTC ? >>> >>> use Time::Local; >>> $diff = (timelocal(localtime) - timelocal(gmtime)) / 36; >>> $diff = sprintf "%+0.4d", $diff; # add sign, leading zero(es) >>> print $diff; >> >>Code assumes "well-behaved" time zones. Not all areas have local time >>which is some multiple of 3600 seconds away from UTC (I don't off hand know >>of any areas which aren't some multiple of 900 seconds from UTC). > >No, it should work for any time zone. > >Kabul, Afghanistan: +0450 >Boston, U.S.A. : -0500 > >-- >Chris Nandor [EMAIL PROTECTED] http://pudge.net/ >Open Source Development Network [EMAIL PROTECTED] http://osdn.com/ -- --- Stewart Leicester | "Ad Astra Per Aspera" JenSoft Technologies | <http://www.id2k.com> <mailto:[EMAIL PROTECTED]> | Guest passcode: 1069340