From de800ea72b5b7d202b23271dc6de1df5300c8de6 Mon Sep 17 00:00:00 2001 From: Eric Floyd Date: Sat, 30 Dec 2023 13:55:09 -0500 Subject: [PATCH] Fixed a timestamp conversion error that failed on MinGW and MSVC --- src/modules/date/Date.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/date/Date.cpp b/src/modules/date/Date.cpp index 6e997e015..3637c2dd7 100644 --- a/src/modules/date/Date.cpp +++ b/src/modules/date/Date.cpp @@ -24,10 +24,11 @@ std::string serializeTimePoint(const auto& timePoint, Date::DateFormat dateForma if (dateFormat == Date::DateFormat::Timestamp) { - ss << std::put_time(&utcTime, "%s"); + ss << std::chrono::duration_cast(timePoint.time_since_epoch()).count(); } - else { + else + { ss << std::put_time(&utcTime, "%Y-%m-%dT%H:%M:%SZ"); }