summaryrefslogtreecommitdiff
path: root/date.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-30 21:25:02 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-30 21:25:02 (GMT)
commiteaa85129230e568757b39b965beee513c8106b37 (patch)
treea3624833da0dd39409c47aa38e71d4e6c71041a3 /date.c
parent17710391299af14fc38cdee10cc7cc9d44668329 (diff)
downloadgit-eaa85129230e568757b39b965beee513c8106b37.zip
git-eaa85129230e568757b39b965beee513c8106b37.tar.gz
git-eaa85129230e568757b39b965beee513c8106b37.tar.bz2
date.c: use the local timezone if none specified
Diffstat (limited to 'date.c')
-rw-r--r--date.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/date.c b/date.c
index b59e832..ffa4246 100644
--- a/date.c
+++ b/date.c
@@ -245,7 +245,8 @@ void parse_date(char *date, char *result, int maxlen)
tm.tm_year = -1;
tm.tm_mon = -1;
tm.tm_mday = -1;
- offset = 0;
+ tm.tm_isdst = -1;
+ offset = -1;
for (;;) {
int match = 0;
@@ -270,7 +271,11 @@ void parse_date(char *date, char *result, int maxlen)
date += match;
}
- then = my_mktime(&tm); /* mktime uses local timezone */
+ /* mktime uses local timezone */
+ then = my_mktime(&tm);
+ if (offset == -1)
+ offset = (then - mktime(&tm)) / 60;
+
if (then == -1)
return;