Merge branch 'bw/perl-timegm-timelocal-fix'
Y2k20 fix ;-) for our perl scripts. * bw/perl-timegm-timelocal-fix: perl: call timegm and timelocal with 4-digit year
This commit is contained in:
@ -534,7 +534,9 @@ If TIME is not supplied, the current local time is used.
|
||||
sub get_tz_offset {
|
||||
# some systems don't handle or mishandle %z, so be creative.
|
||||
my $t = shift || time;
|
||||
my $gm = timegm(localtime($t));
|
||||
my @t = localtime($t);
|
||||
$t[5] += 1900;
|
||||
my $gm = timegm(@t);
|
||||
my $sign = qw( + + - )[ $gm <=> $t ];
|
||||
return sprintf("%s%02d%02d", $sign, (gmtime(abs($t - $gm)))[2,1]);
|
||||
}
|
||||
|
||||
@ -1405,7 +1405,7 @@ sub parse_svn_date {
|
||||
$ENV{TZ} = 'UTC';
|
||||
|
||||
my $epoch_in_UTC =
|
||||
Time::Local::timelocal($S, $M, $H, $d, $m - 1, $Y - 1900);
|
||||
Time::Local::timelocal($S, $M, $H, $d, $m - 1, $Y);
|
||||
|
||||
# Determine our local timezone (including DST) at the
|
||||
# time of $epoch_in_UTC. $Git::SVN::Log::TZ stored the
|
||||
|
||||
Reference in New Issue
Block a user