From: Florian Forster Date: Mon, 5 Mar 2012 09:35:58 +0000 (+0100) Subject: write_mongodb plugin: Actually store time as "date" type. X-Git-Tag: collectd-5.1.0~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=47d9b018d30223078ea44dee5305dfa2225ce95b;p=collectd.git write_mongodb plugin: Actually store time as "date" type. --- diff --git a/src/write_mongodb.c b/src/write_mongodb.c index f61d6224..4f866bc8 100644 --- a/src/write_mongodb.c +++ b/src/write_mongodb.c @@ -87,7 +87,7 @@ static int wm_write (const data_set_t *ds, /* {{{ */ ssnprintf(collection_name, sizeof (collection_name), "collectd.%s", vl->plugin); bson_init(&record); - bson_append_double (&record, "time", CDTIME_T_TO_DOUBLE (vl->time)); + bson_append_date (&record, "time", (bson_date_t) CDTIME_T_TO_MS (vl->time)); bson_append_string (&record, "host", vl->host); bson_append_string (&record, "plugin_instance", vl->plugin_instance); bson_append_string (&record, "type", vl->type);