Skip Menu |

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

Report information
The Basics
Id: 32227
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: tomaszew [...] acoreus.de
Cc:
AdminCc:

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



Subject: Bug in UnixDate for date "Mon Dec 31 11:25:35 2007"
Date: Thu, 10 Jan 2008 15:36:02 +0100
To: bug-Date-Manip [...] rt.cpan.org
From: Radoslaw Tomaszewski <tomaszew [...] acoreus.de>
Hallo, I found a bug in the UnixDate routine: The small source code to show how it can be reproduced: my $date="Mon Dec 31 11:25:35 2007"; my $ret=UnixDate($date, "%L-%m-%d-%H.%M.%S"); print "date conversion: $date = > $ret\n"; The output on my host looks following: date conversion: Mon Dec 31 11:25:35 2007 = > 2008-12-31-11.25.35 After the conversion the year 2007 become 2008 :) !!! Best regards, Radoslaw Tomaszewski
On Thu Jan 10 09:36:28 2008, tomaszew@acoreus.de wrote: Show quoted text
> Hallo, > > I found a bug in the UnixDate routine: > > The small source code to show how it can be reproduced: > > my $date="Mon Dec 31 11:25:35 2007"; > my $ret=UnixDate($date, "%L-%m-%d-%H.%M.%S"); > print "date conversion: $date = > $ret\n"; > > The output on my host looks following: > date conversion: Mon Dec 31 11:25:35 2007 = > 2008-12-31-11.25.35 > > After the conversion the year 2007 become 2008 :) !!! > > Best regards, > Radoslaw Tomaszewski >
That's not a bug. You should be using the %Y format to display the year. The %L is ONLY useful when combined with the %U format, and this is documented in the manual.