Skip Menu |

This queue is for tickets about the Date-Calc CPAN distribution.

Report information
The Basics
Id: 73997
Status: open
Priority: 0/
Queue: Date-Calc

People
Owner: Nobody in particular
Requestors: klezli.istvan [...] gmail.com
Cc:
AdminCc:

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



Subject: N_Delta_YMDHMS returns non-normalized value
Date: Sat, 14 Jan 2012 21:56:44 +0100
To: bug-Date-Calc [...] rt.cpan.org
From: -- <klezli.istvan [...] gmail.com>
Dear Author, dear Cpan, I observed that _*N_Delta_YMDHMS*_subroutine returns non-normalized, strange value. See the short code below. I wanted to calculate how old my son is on a given date. In the second case (2012-01-06) the returned parameter for days is 60! Module version is *Date-Calc*, Gregorian calendar date calculations, *Version: 6.3*, Released: 2009-10-31 I use this Perl version This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 9 registered patches, see perl -V for more detail) Binary build 1005 [290470] provided by ActiveState http://www.ActiveState.com Built May 24 2009 12:17:36 My OS is: Windows XP SP3 Waiting for your answer. Best Regards Istvan from Hungary ---------------------- # source code to reproduce the problem #!perl use Date::Calc qw(N_Delta_YMDHMS); ($ye, $mo, $da, $ho, $mi, $se) = N_Delta_YMDHMS(2011, 04, 06, 22, 00, 00, 2012, 01, 05, 23, 59, 59); print ">>> year: $ye, month: $mo, day: $da, hour: $ho, min: $mi, sec: $se\n"; # >>> year: 0, month: 8, day: 30, hour: 1, min: 59, sec: 59 ($ye, $mo, $da, $ho, $mi, $se) = N_Delta_YMDHMS(2011, 04, 06, 22, 00, 00, 2012, 01, 06, 0, 0, 0); print ">>> year: $ye, month: $mo, day: $da, hour: $ho, min: $mi, sec: $se\n"; # >>> year: 0, month: 7, day: 60, hour: 2, min: 0, sec: 0
I can reproduce this odd behaviour on FreeBSD 10.1-RELEASE-p3 with Perl 5.22.1 and on 3.12.52-20160119.106.ELK6.x86_64 GNU/Linux with Perl 5.10.1. It's a real bug. On Sat Jan 14 15:57:22 2012, klezli.istvan@gmail.com wrote: Show quoted text
> Dear Author, dear Cpan, > > I observed that _*N_Delta_YMDHMS*_subroutine returns non-normalized, > strange value. See the short code below. I wanted to calculate how old > my son is on a given date. In the second case (2012-01-06) the returned > parameter for days is 60! > > Module version is *Date-Calc*, Gregorian calendar date calculations, > *Version: 6.3*, Released: 2009-10-31 > > I use this Perl version > This is perl, v5.10.0 built for MSWin32-x86-multi-thread > (with 9 registered patches, see perl -V for more detail) > Binary build 1005 [290470] provided by ActiveState > http://www.ActiveState.com > Built May 24 2009 12:17:36 > > My OS is: Windows XP SP3 > > Waiting for your answer. > > Best Regards > Istvan from Hungary > > ---------------------- > > # source code to reproduce the problem > #!perl > use Date::Calc qw(N_Delta_YMDHMS); > > ($ye, $mo, $da, $ho, $mi, $se) = N_Delta_YMDHMS(2011, 04, 06, 22, 00, > 00, 2012, 01, 05, 23, 59, 59); > print ">>> year: $ye, month: $mo, day: $da, hour: $ho, min: $mi, sec: > $se\n"; > # >>> year: 0, month: 8, day: 30, hour: 1, min: 59, sec: 59 > > ($ye, $mo, $da, $ho, $mi, $se) = N_Delta_YMDHMS(2011, 04, 06, 22, 00, > 00, 2012, 01, 06, 0, 0, 0); > print ">>> year: $ye, month: $mo, day: $da, hour: $ho, min: $mi, sec: > $se\n"; > # >>> year: 0, month: 7, day: 60, hour: 2, min: 0, sec: 0 >