Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime CPAN distribution.

Report information
The Basics
Id: 83940
Status: resolved
Priority: 0/
Queue: DateTime

People
Owner: Nobody in particular
Requestors: mods [...] hank.org
Cc:
AdminCc:

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



Subject: set_time_zone retains time zone even if invalid local time and exception thrown
From Mailing list on March 13, 2013. my $dt = DateTime->new( year => 2013, month => 3, day => 10, hour => 2, minute => 4, time_zone => 'floating', ); eval { $dt->set_time_zone( 'America/Los_Angeles' ); } || warn "Eval failed with '$@'\n"; print "$dt " . $dt->time_zone . "\n"; Eval failed with 'Invalid local time for date in time zone: America/Los_Angeles ' 2013-03-10T02:04:00 DateTime::TimeZone::America::Los_Angeles=HASH(0x7f9f81ab02a0) The time zone should not have been associated with the DateTIme object.
From: paul [...] city-fan.org
The new test added for this in 1.00 seems to fail for me in perl < 5.14: $ ./Build test t/00load.t ....................... ok t/01sanity.t ..................... ok t/02last-day.t ................... ok t/03components.t ................. ok t/04epoch.t ...................... ok t/05set.t ........................ ok t/06add.t ........................ ok t/07compare.t .................... ok t/09greg.t ....................... ok t/10subtract.t ................... ok t/11duration.t ................... ok t/12week.t ....................... ok t/13strftime.t ................... ok t/14locale.t ..................... ok t/15jd.t ......................... ok t/16truncate.t ................... ok t/17set-return.t ................. ok t/18today.t ...................... ok t/19leap-second.t ................ ok t/20infinite.t ................... ok t/21bad-params.t ................. ok t/22from-doy.t ................... ok t/23storable.t ................... ok t/24from-object.t ................ ok t/25add-subtract.t ............... ok t/26dt-leapsecond-pm.t ........... ok t/27delta.t ...................... ok t/28dow.t ........................ ok t/29overload.t ................... ok t/30future-tz.t .................. ok t/31formatter.t .................. ok t/32leap-second2.t ............... ok t/33seconds-offset.t ............. ok false exception caught by Test::Fatal::exception at /usr/share/perl5/vendor_perl/Test/Fatal.pm line 29 Test::Fatal::__ANON__('') called at /usr/share/perl5/vendor_perl/Try/Tiny.pm line 100 Try::Tiny::try('CODE(0x18811c8)', 'Try::Tiny::Catch=REF(0x1730bc0)') called at /usr/share/perl5/vendor_perl/Test/Fatal.pm line 30 Test::Fatal::exception('CODE(0x1881168)') called at t/34set-tz.t line 53 # Tests were run but no plan was declared and done_testing() was not seen. t/34set-tz.t ..................... Dubious, test returned 255 (wstat 65280, 0xff00) All 8 subtests passed t/35rd-values.t .................. ok t/36invalid-local.t .............. ok t/37local-add.t .................. ok t/38local-subtract.t ............. ok t/39no-so.t ...................... ok t/40leap-years.t ................. ok t/41cldr-format.t ................ ok t/42duration-class.t ............. ok ...