From: Sebastian Harl Date: Thu, 15 Nov 2012 14:14:10 +0000 (+0100) Subject: utils_time: cdtime_to_iso8601(): Include timezone information as well. X-Git-Tag: collectd-5.2.0~13^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=25e9d1cb2d4fd2908b48640997e0922888ec5d8e;p=collectd.git utils_time: cdtime_to_iso8601(): Include timezone information as well. --- diff --git a/src/utils_time.c b/src/utils_time.c index f30dc0fa..6789758d 100644 --- a/src/utils_time.c +++ b/src/utils_time.c @@ -87,6 +87,11 @@ size_t cdtime_to_iso8601 (char *s, size_t max, cdtime_t t) /* {{{ */ len += (n < max - len) ? n : max - len; } + if (max - len > 3) { + int n = strftime (s + len, max - len, "%z", &t_tm); + len += (n < max - len) ? n : max - len; + } + s[max - 1] = '\0'; return len; } /* }}} size_t cdtime_to_iso8601 */