[PATCH] Fix strange timezone handling
authorLinus Torvalds <torvalds@osdl.org>
Wed, 21 Sep 2005 22:50:28 +0000 (15:50 -0700)
committerJunio C Hamano <junkio@cox.net>
Thu, 22 Sep 2005 08:53:36 +0000 (01:53 -0700)
commit01c6ad29bd1b647d4fd1acea54e374c740ec3c10
tree4dd367cdbf32a266f5199ecacaa90ce761cfe351
parentacfadcfb48e34fdc441e9cffbb385fce9693b363
[PATCH] Fix strange timezone handling

We generate the ASCII representation of our internal date representation
("seconds since 1970, UTC + timezone information") in two different
places.

One of them uses the stupid and obvious way to make sure that it gets the
sexagecimal representation right for negative timezones even if they might
not be exact hours, and the other one depends on the modulus operator
always matching the sign of argument.

Hey, the clever one works. And C90 even specifies that behaviour. But I
had to think about it for a while when I was re-visiting this area, and
even if I didn't have to, it's kind of strange to have two different ways
to print out the same data format.

So use a common helper for this. And select the stupid and straighforward
way.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
date.c