From cfea8e077b9a8956080688ab40e9efd812c2a0c5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 5 Mar 2006 14:48:01 -0800 Subject: blame and annotate: show localtime with timezone. Earlier they showed gmtime and timezone, which was inconsistent with the way our commits and tags are pretty-printed. Signed-off-by: Junio C Hamano --- git-annotate.perl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'git-annotate.perl') diff --git a/git-annotate.perl b/git-annotate.perl index d93ee19c7e..b113def97b 100755 --- a/git-annotate.perl +++ b/git-annotate.perl @@ -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.. -- cgit v1.2.3