aboutsummaryrefslogtreecommitdiff
path: root/git-annotate.perl
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-05 14:48:01 -0800
committerJunio C Hamano <junkio@cox.net>2006-03-05 16:02:44 -0800
commitcfea8e077b9a8956080688ab40e9efd812c2a0c5 (patch)
tree79ff446366bf1d072667313c6a8188e28a74cb57 /git-annotate.perl
parenta0fb95e3199810268cfe88c7c4ff0d9958e07062 (diff)
downloadgit-cfea8e077b9a8956080688ab40e9efd812c2a0c5.tar.gz
git-cfea8e077b9a8956080688ab40e9efd812c2a0c5.tar.xz
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 <junkio@cox.net>
Diffstat (limited to 'git-annotate.perl')
-rwxr-xr-xgit-annotate.perl8
1 files changed, 7 insertions, 1 deletions
diff --git a/git-annotate.perl b/git-annotate.perl
index d93ee19c7..b113def97 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..