[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Q on Mac Time Zones



At 01.02 -0500 1999.01.08, Walter Torres wrote:
>Any one have any idea on how to get the Time Zone setting out of the Mac?

Untested in other places, but should work anywhere, I think:

  #!perl
  use Time::Local;
  $diff = (timelocal(localtime) - timelocal(gmtime)) / 36;
  $diff =~ s/^-?(\d{3})$/-0$1/;  # add leading zero if only three digits
  print $diff;

On my Mac, $diff is -0500 (which is correct for the East Coast this time of
year).

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch