]> Lady’s Gitweb - Gitweb/commit
gitweb: Fix handling of fractional timezones in parse_date
authorJakub Narebski <redacted>
Fri, 25 Mar 2011 19:20:49 +0000 (20:20 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:30 +0000 (00:51 -0400)
commit1a989512bce6f337f0e7becb6d934362003402d8d7ee5853243e1d48c45b1901
treeef42290b885068cb75e63d19e0df3ec6ed99cdbf1dec77b7a434c63c3c3a3b04
parent6192520d90fd9452ca9438c717f36f35c9f8d91a28169ffaf9dbefcad76b57b2
gitweb: Fix handling of fractional timezones in parse_date

Fractional timezones, like -0330 (NST used in Canada) or +0430
(Afghanistan, Iran DST), were not handled properly in parse_date; this
means values such as 'minute_local' and 'iso-tz' were not generated
correctly.

This was caused by two mistakes:

* sign of timezone was applied only to hour part of offset, and not
  as it should be also to minutes part (this affected only negative
  fractional timezones).

* 'int $h + $m/60' is 'int($h + $m/60)' and not 'int($h) + $m/60',
  so fractional part was discarded altogether ($h is hours, $m is
  minutes, which is always less than 60).

Note that positive fractional timezones +0430, +0530 and +1030 can be
found as authortime in git.git repository itself.

For example http://repo.or.cz/w/git.git/commit/88d50e7 had authortime
of "Fri, 8 Jan 2010 18:48:07 +0000 (23:48 +0530)", which is not marked
with 'atnight', when "git show 88d50e7" gives correct author date of
"Sat Jan 9 00:18:07 2010 +0530".

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.188 seconds and 5 git commands to generate.