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 attached patch (not tested)
Subject: | fix.patch |
Index: Badger-0.12/lib/Badger/Period.pm
===================================================================
--- Badger-0.12.orig/lib/Badger/Period.pm
+++ Badger-0.12/lib/Badger/Period.pm
@@ -156,8 +156,10 @@ sub join_uri {
sub epoch_time {
my $self = shift;
+ my @p = $self->posix_args;
+ $p[5] += 1900;
return $self->{ etime } ||= timelocal(
- $self->posix_args
+ @p
);
}
Index: Badger-0.12/lib/Badger/Timestamp.pm
===================================================================
--- Badger-0.12.orig/lib/Badger/Timestamp.pm
+++ Badger-0.12/lib/Badger/Timestamp.pm
@@ -203,7 +203,7 @@ sub epoch_time {
return $self->{ etime } ||= timelocal(
@$self{@SMHD},
$self->{ month } - 1,
- $self->{ year } - 1900
+ $self->{ year }
);
}