Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-06 01:48:01 +0300
committerJunio C Hamano <junkio@cox.net>2006-03-06 03:02:44 +0300
commitcfea8e077b9a8956080688ab40e9efd812c2a0c5 (patch)
tree79ff446366bf1d072667313c6a8188e28a74cb57 /git-annotate.perl
parenta0fb95e3199810268cfe88c7c4ff0d9958e07062 (diff)
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 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..