{
c_psql_database_t *db;
- char time_str[1024];
+ char time_str[32];
char values_name_str[1024];
char values_str[1024];
assert (db->database != NULL);
assert (db->writers != NULL);
- ssnprintf (time_str, sizeof (time_str),
- "%f", CDTIME_T_TO_DOUBLE (vl->time));
+ if (cdtime_to_iso8601 (time_str, sizeof (time_str), vl->time) == 0) {
+ log_err ("c_psql_write: Failed to convert time to ISO 8601 format");
+ return -1;
+ }
if (values_name_to_sqlarray (ds,
values_name_str, sizeof (values_name_str)) == NULL)