From f968bb94ac8236ac1c4b74f4cd636ce174b7b700 Mon Sep 17 00:00:00 2001 From: Igor Peshansky Date: Thu, 15 Sep 2016 13:45:04 -0400 Subject: [PATCH 1/1] Force use of local time in the postgresql plugin. Update postgresql docs to reflect reality. --- src/collectd.conf.pod | 2 +- src/postgresql.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 0fa74d54..20d8c6b6 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -5726,7 +5726,7 @@ values are made available through those parameters: =item B<$1> -The timestamp of the queried value as a floating point number. +The timestamp of the queried value as an RFC 3339-formatted local time. =item B<$2> diff --git a/src/postgresql.c b/src/postgresql.c index c92f6ee1..8b609492 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -833,8 +833,7 @@ static int c_psql_write (const data_set_t *ds, const value_list_t *vl, assert (db->database != NULL); assert (db->writers != NULL); - /* TODO: Should this be rfc3339nano_local()? */ - if (rfc3339nano (time_str, sizeof (time_str), vl->time) != 0) { + if (rfc3339nano_local (time_str, sizeof (time_str), vl->time) != 0) { log_err ("c_psql_write: Failed to convert time to RFC 3339 format"); return -1; } -- 2.11.0