From 29b9a528641706eed112322e148a598e8afc73ae Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Thu, 12 Oct 2006 15:15:26 +0000 Subject: [PATCH] fixed end-of-month problem in exsltDateCurrent (#359246) * libexslt/date.c: fixed end-of-month problem in exsltDateCurrent (#359246) --- ChangeLog | 5 +++++ libexslt/date.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ace4211..567d782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 12 23:12:24 HKT 2006 William Brack + + * libexslt/date.c: fixed end-of-month problem in exsltDateCurrent + (#359246) + Thu Oct 12 14:39:37 CEST 2006 Daniel Veillard * libxslt/preproc.c: applied patch from Mike Hommey fixing 2 diff --git a/libexslt/date.c b/libexslt/date.c index 59ca136..22a2cc1 100644 --- a/libexslt/date.c +++ b/libexslt/date.c @@ -746,7 +746,7 @@ static exsltDateValPtr exsltDateCurrent (void) { struct tm *localTm, *gmTm; - time_t secs; + time_t secs, gsecs; #if HAVE_LOCALTIME_R struct tm localTmS; #endif @@ -787,11 +787,15 @@ exsltDateCurrent (void) gmTm = gmtime(&secs); #endif ret->value.date.tz_flag = 0; +#if 0 ret->value.date.tzo = (((ret->value.date.day * 1440) + (ret->value.date.hour * 60) + ret->value.date.min) - ((gmTm->tm_mday * 1440) + (gmTm->tm_hour * 60) + gmTm->tm_min)); +#endif + gsecs = mktime(gmTm); + ret->value.date.tzo = (secs - gsecs) / 60; return ret; } -- 2.7.4