blame and annotate: show localtime with timezone.
[gitweb.git] / git-annotate.perl
index d93ee19c7e7ff42762071c9df6f31da5dfa0fe80..b113def97bd41c18f3d6e24c9952c50dbb8e2ad8 100755 (executable)
@@ -418,7 +418,13 @@ sub format_date {
                return $_[0];
        }
        my ($timestamp, $timezone) = split(' ', $_[0]);
-       return strftime("%Y-%m-%d %H:%M:%S " . $timezone, gmtime($timestamp));
+       my $minutes = abs($timezone);
+       $minutes = int($minutes / 100) * 60 + ($minutes % 100);
+       if ($timezone < 0) {
+           $minutes = -$minutes;
+       }
+       my $t = $timestamp + $minutes * 60;
+       return strftime("%Y-%m-%d %H:%M:%S " . $timezone, gmtime($t));
 }
 
 # Copied from git-send-email.perl - We need a Git.pm module..