X-Git-Url: https://git.tokkee.org/?p=rrdtool-all.git;a=blobdiff_plain;f=program%2Fsrc%2Frrd_fetch_libdbi.c;h=fdd10c49b9ddaf9210374a2793b0d387d5b9de6f;hp=71a6bcac8eb7e89e6370e9ae9fefe620e2aa9064;hb=dd79c878116562780f148adcb5535d472be63a47;hpb=a646ef0cc9492bc5a9d7ed88bc491bab93d67a1b diff --git a/program/src/rrd_fetch_libdbi.c b/program/src/rrd_fetch_libdbi.c index 71a6bcac..fdd10c49 100644 --- a/program/src/rrd_fetch_libdbi.c +++ b/program/src/rrd_fetch_libdbi.c @@ -1,6 +1,6 @@ #include "rrd_tool.h" #include "unused.h" -#include +// #include #include /* the structures */ @@ -462,9 +462,18 @@ rrd_fetch_fn_libdbi( /* if we have leading '*', then we have a TIMEDATE Field*/ if (table_help.timestamp[0]=='*') { struct tm tm; +#ifdef HAVE_TIMEZONE + extern long timezone; +#endif time_t t=time(NULL); localtime_r(&t,&tm); - gmt_offset=tm.tm_gmtoff; +#ifdef HAVE_TM_GMTOFF + gmt_offset=tm.TM_GMTOFF; +#else +#ifdef HAVE_TIMEZONE + gmt_offset=timezone; +#endif +#endif isunixtime=0; table_help.timestamp++; } /* hex-unescape the value */