From: Igor Peshansky Date: Thu, 15 Sep 2016 17:45:04 +0000 (-0400) Subject: Force use of local time in the postgresql plugin. X-Git-Tag: collectd-5.7.0~77^2~2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=f968bb94ac8236ac1c4b74f4cd636ce174b7b700;hp=e2cb258c7b6ce456f4119fd1454c85b479fa3e2d;p=collectd.git Force use of local time in the postgresql plugin. Update postgresql docs to reflect reality. --- 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; }