From: Florian Forster Date: Thu, 7 Jul 2011 14:59:13 +0000 (+0200) Subject: src/utils_format_json.c: Correctly format the time of value lists. X-Git-Tag: collectd-5.0.1~10 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=cf9ac771ade7c5ba75ab13d2b4f2482983994840;p=collectd.git src/utils_format_json.c: Correctly format the time of value lists. Users should get epoch, not our internal format. --- diff --git a/src/utils_format_json.c b/src/utils_format_json.c index 65c886b6..2a5526b2 100644 --- a/src/utils_format_json.c +++ b/src/utils_format_json.c @@ -264,7 +264,7 @@ static int value_list_to_json (char *buffer, size_t buffer_size, /* {{{ */ return (status); BUFFER_ADD (",\"dsnames\":%s", temp); - BUFFER_ADD (",\"time\":%lu", (unsigned long) vl->time); + BUFFER_ADD (",\"time\":%.3f", CDTIME_T_TO_DOUBLE (vl->time)); BUFFER_ADD (",\"interval\":%.3f", CDTIME_T_TO_DOUBLE (vl->interval)); #define BUFFER_ADD_KEYVAL(key, value) do { \