Eric Roode on 26 Mar 2008 08:04:49 -0700


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

Re: Time zone


Quoting Walt Mankowski <waltman@pobox.com>:

> On Wed, Mar 26, 2008 at 10:11:35AM -0400, Hans Dieter Pearcey wrote:
> > On Wed, Mar 26, 2008 at 10:03:11AM -0400, Eric Roode wrote:
> > > Does anyone know a good way to get the current locale's time zone,
> without
> > > relying on any non-core modules?
> >
> > see how DateTime::TimeZone::Local does it
>
> DateTime::TimeZone::Local::Win32.pm gets it out of the registry from
>
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation\\StandardName.
> Maybe there's a StandardAbbev in there, too?
>
> Another thought would be to use cygwin's date(1) command directly:
>
> % perl -le '$TZ = `date +%Z`; chomp $TZ; print $TZ'
> EDT

Both good suggestions, but here's my problem: It's for my Time::Format module on
CPAN.  I need a solution that works across all platforms.

I think I will have to take Dieter's suggestion and lift code from the various
DateTime::TimeZone::Local modules.  This looks to be rather a headache.

-- 
Eric


___________________________________________________________________

Privacy Notice: This message has been sent via www.zoemail.net using
patented e-mail protection technology developed by AT&T Labs. Reply to
the "keyed address" above to ensure delivery.

-
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**


  • Follow-Ups:
  • References: