Skip Menu |
 

This queue is for tickets about the TimeDate CPAN distribution.

Report information
The Basics
Id: 76968
Status: open
Priority: 0/
Queue: TimeDate

People
Owner: Nobody in particular
Requestors: cary.millsap [...] method-r.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: TimeDate 1.20 tz2zone("America/Chicago") doesn't work
Date: Thu, 3 May 2012 12:30:11 -0500
To: bug-TimeDate [...] rt.cpan.org
From: Cary Millsap <cary.millsap [...] method-r.com>
Graham, Using Time::Zone in TimeDate v1.20, I've found that tz2zone() doesn't convert time zones of the form "America/Chicago" to a value usable by tz_offset. My OS (Mac OS X, Linux, Solaris) does consider TZ values of the form "America/Chicago" to be valid: $ zdump "America/Chicago" America/Chicago Thu May 3 12:23:16 2012 CDT Here is a test in Perl that illustrates the problem: $ more t.pl use strict; use warnings; use Time::Zone; $ENV{TZ} = "-0500"; printf "%20s %20s %20s\n", qw(input tz2zone tzoffset(tz2zone)); printf "%20s %20s %20s\n", '-'x20, '-'x20, '-'x20; for (qw(-0500 CST6CDT America/Chicago)) { printf "%20s %20s %20s\n", $_, tz2zone($_), tz_offset(tz2zone($_))//"undef"; } $ perl t.pl input tz2zone tzoffset(tz2zone) -------------------- -------------------- -------------------- -0500 -0500 -18000 CST6CDT CST -21600 America/Chicago America/Chicago undef Thank you for looking into it. Cary Millsap
Subject: Re: [rt.cpan.org #76968] TimeDate 1.20 tz2zone("America/Chicago") doesn't work
Date: Thu, 3 May 2012 12:38:29 -0500
To: bug-TimeDate [...] rt.cpan.org
From: Graham Barr <gbarr [...] pobox.com>
Download (untitled) / with headers
text/plain 496b
On May 3, 2012, at 12:31 , Cary Millsap via RT wrote: Show quoted text
> Using Time::Zone in TimeDate v1.20, I've found that tz2zone() doesn't > convert time zones of the form "America/Chicago" to a value usable by > tz_offset. My OS (Mac OS X, Linux, Solaris) does consider TZ values of the > form "America/Chicago" to be valid:
tz2zone was never intended to support named zones, it was intended to convert the likes of -0800 etc. I would suggest using DateTime::TimeZone to convert named timezones. Graham.
Subject: Re: [rt.cpan.org #76968] TimeDate 1.20 tz2zone("America/Chicago") doesn't work
Date: Thu, 3 May 2012 12:51:15 -0500
To: bug-TimeDate [...] rt.cpan.org
From: Cary Millsap <cary.millsap [...] method-r.com>
Download (untitled) / with headers
text/plain 717b
Thank you, Graham. I'll look there. Cary On Thu, May 3, 2012 at 12:38 PM, Graham Barr via RT < bug-TimeDate@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=76968 > > > On May 3, 2012, at 12:31 , Cary Millsap via RT wrote:
> > Using Time::Zone in TimeDate v1.20, I've found that tz2zone() doesn't > > convert time zones of the form "America/Chicago" to a value usable by > > tz_offset. My OS (Mac OS X, Linux, Solaris) does consider TZ values of
> the
> > form "America/Chicago" to be valid:
> > tz2zone was never intended to support named zones, it was intended to > convert the likes of -0800 etc. > > I would suggest using DateTime::TimeZone to convert named timezones. > > Graham. > > >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.