add the seconds to the report time

This commit is contained in:
Sven Czarnian
2021-10-11 09:46:47 +02:00
parent 9ce9503e7b
commit 9f6f7c60d0

View File

@@ -10,6 +10,7 @@
*/ */
#include <aman/com/AircraftReporter.h> #include <aman/com/AircraftReporter.h>
#include <aman/helper/String.h>
#include "ZmqContext.h" #include "ZmqContext.h"
@@ -68,8 +69,8 @@ bool AircraftReporter::send(aman::AircraftReport& report) {
/* set the report time */ /* set the report time */
std::stringstream stream; std::stringstream stream;
auto reportTime = std::chrono::utc_clock::now(); auto reportTime = std::chrono::utc_clock::now();
stream << std::format("{0:%y%m%d%H%M}", reportTime); stream << std::format("{0:%y%m%d%H%M%S}", reportTime);
report.set_reporttime(stream.str()); report.set_reporttime(String::splitString(stream.str(), ".")[0]);
/* serialize the report */ /* serialize the report */
std::string serialized = report.SerializeAsString(); std::string serialized = report.SerializeAsString();