diff options
Diffstat (limited to 'src/logging.cpp')
-rw-r--r-- | src/logging.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/logging.cpp b/src/logging.cpp index 4e6f6ddf4a..6a7991255d 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -349,11 +349,12 @@ std::string BCLog::Logger::LogTimestampStr(const std::string& str) return str; if (m_started_new_line) { - int64_t nTimeMicros = GetTimeMicros(); - strStamped = FormatISO8601DateTime(nTimeMicros/1000000); + const auto now{SystemClock::now()}; + const auto now_seconds{std::chrono::time_point_cast<std::chrono::seconds>(now)}; + strStamped = FormatISO8601DateTime(TicksSinceEpoch<std::chrono::seconds>(now_seconds)); if (m_log_time_micros) { strStamped.pop_back(); - strStamped += strprintf(".%06dZ", nTimeMicros%1000000); + strStamped += strprintf(".%06dZ", Ticks<std::chrono::microseconds>(now - now_seconds)); } std::chrono::seconds mocktime = GetMockTime(); if (mocktime > 0s) { |