X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=date.c;h=1f366a67f8b0d282088a26d900a3031fdc3e6012;hb=d6db01075b65da2b8584a0450619390893aae103;hp=7371bc136a650ccfcee5e87eafb3e738a227d8bd;hpb=f80cd783c6f346388bbb0a6a15672be99a71f7ed;p=git.git diff --git a/date.c b/date.c index 7371bc13..1f366a67 100644 --- a/date.c +++ b/date.c @@ -10,6 +10,8 @@ #include #include +#include "cache.h" + static time_t my_mktime(struct tm *tm) { static const int mdays[] = { @@ -51,9 +53,9 @@ const char *show_date(unsigned long time, int tz) 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;