aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-25 17:57:08 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-25 17:57:08 -0700
commit421446b6fcf2c3767e7e714388163b29a65f45cc (patch)
tree2b53a022225c3b4366e4b0ec56ef12545dfb3a67 /gitweb
parentd6d9e76d7f06c5ba94517d258e051544885780c5 (diff)
parent78bc46675353e4833a59e0f4dfa47d57a9c1a46b (diff)
downloadgit-421446b6fcf2c3767e7e714388163b29a65f45cc.tar.gz
git-421446b6fcf2c3767e7e714388163b29a65f45cc.tar.xz
Sync with 1.7.4.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl6
1 files changed, 4 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0178633b2..ee69ea683 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2921,8 +2921,10 @@ sub parse_date {
$date{'iso-8601'} = sprintf "%04d-%02d-%02dT%02d:%02d:%02dZ",
1900+$year, 1+$mon, $mday, $hour ,$min, $sec;
- $tz =~ m/^([+\-][0-9][0-9])([0-9][0-9])$/;
- my $local = $epoch + ((int $1 + ($2/60)) * 3600);
+ my ($tz_sign, $tz_hour, $tz_min) =
+ ($tz =~ m/^([-+])(\d\d)(\d\d)$/);
+ $tz_sign = ($tz_sign eq '-' ? -1 : +1);
+ my $local = $epoch + $tz_sign*((($tz_hour*60) + $tz_min)*60);
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = gmtime($local);
$date{'hour_local'} = $hour;
$date{'minute_local'} = $min;