[email protected] wrote:
>the ideal would be to include the zone and the invalid local time in the
>message.

I've just uploaded DT:TZ:SystemV 0.005 to CPAN, and it does this:

$ perl -MDateTime::TimeZone::SystemV -MDateTime -lwe 'print 
DateTime::TimeZone::SystemV->new(recipe=>"CST6CDT,M3.2.0,M11.1.0",name=>"America/Chicago")->offset_for_local_datetime(DateTime->new(year=>2011,month=>3,day=>13,hour=>2,minute=>30,time_zone=>"UTC"))'
local time 2011-03-13T02:30:00 does not exist in the America/Chicago timezone 
due to offset change at -e line 1

The error message is now very informative.  The new option to override
the zone name (which was previously always the recipe) will be used
by DT:TZ:Tzfile in order to get the right name in this error message.
(DT:TZ:SystemV supplies the far-future part of DT:TZ:Tzfile.)

New DT:TZ:Tzfile tomorrow.  Then DT:TZ:Olson.  Then DT:TZ.

-zefram

Reply via email to