Skip Menu |

This queue is for tickets about the Calendar-Simple CPAN distribution.

Report information
The Basics
Id: 124532
Status: resolved
Priority: 0/
Queue: Calendar-Simple

People
Owner: DAVECROSS [...] cpan.org
Requestors: bitcardbmw [...] lsmod.de
Cc:
AdminCc:

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



Subject: timelocal should be called with 4-digit year
man Time::Local says Whenever possible, use an absolute four digit year instead. With a detailed explanation about ambiguity of 2-digit years above that. Please review/test/merge the below patch --- Calendar-Simple-1.21.orig/lib/Calendar/Simple.pm +++ Calendar-Simple-1.21/lib/Calendar/Simple.pm @@ -89 +89 @@ sub calendar { - $first = (localtime timelocal 0, 0, 0, 1, $mon -1, $year - 1900)[6]; + $first = (localtime timelocal 0, 0, 0, 1, $mon -1, $year)[6];
On Thu Feb 22 04:16:09 2018, bmwiedemann wrote: Show quoted text
> man Time::Local says > > Whenever possible, use an absolute four digit year instead. > > With a detailed explanation about ambiguity of 2-digit years above that. > > Please review/test/merge the below patch > > --- Calendar-Simple-1.21.orig/lib/Calendar/Simple.pm > +++ Calendar-Simple-1.21/lib/Calendar/Simple.pm > @@ -89 +89 @@ sub calendar { > - $first = (localtime timelocal 0, 0, 0, 1, $mon -1, $year - 1900)[6]; > + $first = (localtime timelocal 0, 0, 0, 1, $mon -1, $year)[6];
Thanks for the suggestion. Version 1.22 is on its way to CPAN with this fix. Dave...