Skip Menu |

This queue is for tickets about the Time-Piece CPAN distribution.

Report information
The Basics
Id: 48313
Status: resolved
Priority: 0/
Queue: Time-Piece

People
Owner: Nobody in particular
Requestors: david.warring [...] gmail.org
Cc:
AdminCc:

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



Subject: add_months method loses localtime
The 'add_months' method is losing the localtime setting. Consider: #!/usr/bin/perl use warnings; use strict; use Time::Piece; use constant 'c_islocal' => 10; print '$Time::Piece::VERSION='.$Time::Piece::VERSION."\n"; my $t1 = localtime; print 'length='.scalar @$t1.', $t1[c_islocal]='.$t1- Show quoted text
>[c_islocal]."\n";
my $t2 = $t1->add_months(1); print 'length='.scalar @$t2.', $t2[c_islocal]='.$t2- Show quoted text
>[c_islocal]."\n";
This is producing: $Time::Piece::VERSION=1.15 length=11, $t1[c_islocal]=1 length=12, $t2[c_islocal]=0 I would have expected: $Time::Piece::VERSION=1.15 length=11, $t1[c_islocal]=1 length=11, $t2[c_islocal]=1
Fixed in svn. New release imminent.