mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2026-01-03 23:28:55 +03:00
Update interface_influxdb.cpp
This commit is contained in:
@@ -71,7 +71,9 @@ void InfluxDBPublish(std::string _key, std::string _content, std::string _timest
|
|||||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "InfluxDBPublish - Key: " + _key + ", Content: " + _content + ", Timestamp: " + _timestamp);
|
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "InfluxDBPublish - Key: " + _key + ", Content: " + _content + ", Timestamp: " + _timestamp);
|
||||||
|
|
||||||
// generate timestamp (TODO: parse result timestamp passed as string and convert it to POSIX timestamp?)
|
// generate timestamp (TODO: parse result timestamp passed as string and convert it to POSIX timestamp?)
|
||||||
time_t now = time(NULL);
|
// time_t now = time(NULL);
|
||||||
|
time_t now;
|
||||||
|
time(&now);
|
||||||
char nowTimestamp[21];
|
char nowTimestamp[21];
|
||||||
// pad with zeroes to get nanoseconds
|
// pad with zeroes to get nanoseconds
|
||||||
sprintf(nowTimestamp,"%jd000000000", (intmax_t)now);
|
sprintf(nowTimestamp,"%jd000000000", (intmax_t)now);
|
||||||
|
|||||||
Reference in New Issue
Block a user