src/utils_format_json.c: Correctly format the time of value lists.
authorFlorian Forster <octo@huhu.verplant.org>
Thu, 7 Jul 2011 14:59:13 +0000 (16:59 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Thu, 7 Jul 2011 14:59:13 +0000 (16:59 +0200)
Users should get epoch, not our internal format.

src/utils_format_json.c

index 65c886b..2a5526b 100644 (file)
@@ -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 { \