From 9d98ccafa13452f76677fe6623c28f08b41db22a Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 12 Apr 2008 09:21:31 +0000 Subject: [PATCH 1/1] do not mess with dst status after running localtime, the system gets confused otherwhise when it comes to times during the switch over periode as DST changes to non DST. -- tobi git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1323 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/parsetime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program/src/parsetime.c b/program/src/parsetime.c index 919dd50b..74063b20 100644 --- a/program/src/parsetime.c +++ b/program/src/parsetime.c @@ -721,7 +721,7 @@ day(struct rrd_time_value *ptv) break; } - if (mon > 19700101 && mon < 24000101){ /*works between 1900 and 2400 */ + if (mon > 19700101 && mon < 24000101){ /*works between 1970 and 2400 */ char cmon[3],cmday[3],cyear[5]; strncpy(cyear,sc_token,4);cyear[4]='\0'; year = atol(cyear); @@ -798,7 +798,8 @@ parsetime(const char *tspec, struct rrd_time_value *ptv) ptv->type = ABSOLUTE_TIME; ptv->offset = 0; ptv->tm = *localtime(&now); - ptv->tm.tm_isdst = -1; /* mk time can figure this out for us ... */ + ptv->tm.tm_isdst = -1; /* by default lets mk time guess dst status ... */ + token(); switch (sc_tokid) { @@ -915,7 +916,6 @@ parsetime(const char *tspec, struct rrd_time_value *ptv) panic(e("unparsable trailing text: '...%s%s'", sc_token, sct)); } - ptv->tm.tm_isdst = -1; /* for mktime to guess DST status */ if( ptv->type == ABSOLUTE_TIME ) if( mktime( &ptv->tm ) == -1 ) { /* normalize & check */ /* can happen for "nonexistent" times, e.g. around 3am */ -- 2.30.2