threads / patch / 654

patchfix show_date() for positive timezones

Subject: [PATCH] fix show_date() for positive timezones

## tl;dr

One message between May 18, 2005 and May 18, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Nicolas Pitre· May 18, 2005, 21:11 UTC · lore
Signed-off-by: Nicolas Pitre <nico@cam.org>
Show changes to date.c +2 −2
--- a/date.c
+++ b/date.c
@@ -51,9 +51,9 @@ const char *show_date(unsigned long time
 	int minutes;
 
 	minutes = tz < 0 ? -tz : tz;
-	minutes = (tz / 100)*60 + (tz % 100);
+	minutes = (minutes / 100)*60 + (minutes % 100);
 	minutes = tz < 0 ? -minutes : minutes;
-	t = time - minutes * 60;
+	t = time + minutes * 60;
 	tm = gmtime(&t);
 	if (!tm)
 		return NULL;

← back to recent threads