[PATCH] fix show_date() for positive timezones
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>maint
parent
850e82d889
commit
fbab835c03
4
date.c
4
date.c
|
@ -51,9 +51,9 @@ const char *show_date(unsigned long time, int tz)
|
||||||
int minutes;
|
int minutes;
|
||||||
|
|
||||||
minutes = tz < 0 ? -tz : tz;
|
minutes = tz < 0 ? -tz : tz;
|
||||||
minutes = (tz / 100)*60 + (tz % 100);
|
minutes = (minutes / 100)*60 + (minutes % 100);
|
||||||
minutes = tz < 0 ? -minutes : minutes;
|
minutes = tz < 0 ? -minutes : minutes;
|
||||||
t = time - minutes * 60;
|
t = time + minutes * 60;
|
||||||
tm = gmtime(&t);
|
tm = gmtime(&t);
|
||||||
if (!tm)
|
if (!tm)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue