X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_fetch_libdbi.c;h=1d6495dead3cbbd56f3e18a5e6ff2a311ba04e4d;hb=d85e6bdfe82fdc4d16898df43f8a5371503816ae;hp=71a6bcac8eb7e89e6370e9ae9fefe620e2aa9064;hpb=470b43490f698918399f0fb5505a9dfd5df6a4e2;p=rrdtool.git diff --git a/src/rrd_fetch_libdbi.c b/src/rrd_fetch_libdbi.c index 71a6bca..1d6495d 100644 --- a/src/rrd_fetch_libdbi.c +++ b/src/rrd_fetch_libdbi.c @@ -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 */