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: 13221
Status: resolved
Priority: 0/
Queue: DateTime

People
Owner: Nobody in particular
Requestors: Patrick.Stein [...] jinx.de
Cc:
AdminCc:

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



Subject: Date add returns wron result when timezone is set.
perl -e 'use DateTime; $a = DateTime->new( year=>2005,month=>3,day=>1,time_zone=>"Europe/Berlin" ); print $a."\n";$a->add( "months"=>1 ); print $a."\n";' returns 2005-03-01T00:00:00 2005-03-29T01:00:00 but one month from 1st march is 1st april.
[guest - Mon Jun 13 07:20:47 2005]: Show quoted text
> perl -e 'use DateTime; $a = DateTime->new( > year=>2005,month=>3,day=>1,time_zone=>"Europe/Berlin" ); print > $a."\n";$a->add( "months"=>1 ); print $a."\n";' > > returns > > 2005-03-01T00:00:00 > 2005-03-29T01:00:00 > > but one month from 1st march is 1st april.
I think that's because you've crossed a daylight savings time boundary. Convert to UTC do the calculation, and convert back
Date: Mon, 15 Aug 2005 14:45:07 -0500 (CDT)
From: Dave Rolsky <autarch [...] urth.org>
To: Guest via RT <bug-DateTime [...] rt.cpan.org>
Subject: Re: [cpan #13221] Date add returns wron result when timezone is set.
RT-Send-Cc:
On Mon, 15 Aug 2005, Guest via RT wrote: Show quoted text
>> 2005-03-01T00:00:00 >> 2005-03-29T01:00:00 >> >> but one month from 1st march is 1st april.
> > I think that's because you've crossed a daylight savings time boundary. > Convert to UTC do the calculation, and convert back
I'm planning some API changes/new API bits that should address this for the next major release. /*=================================================== VegGuide.Org www.BookIRead.com Your guide to all that's veg. My book blog ===================================================*/