MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / ToIsoDate

Method ToIsoDate

lib/mdflib/mdflib/src/timestamp.cpp:53–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51uint64_t UtcTimestamp::GetUtcTimeNs() const { return utc_timestamp_; }
52
53std::string UtcTimestamp::ToIsoDate() const {
54 const auto system_time = static_cast<std::time_t>(utc_timestamp_ / 1'000'000'000);
55 std::ostringstream text;
56 if (const struct tm *bt = std::gmtime(&system_time);
57 bt != nullptr ) {
58 text << std::put_time(bt, "%Y-%m-%dZ");
59 }
60 return text.str();
61}
62
63std::string UtcTimestamp::ToIsoTime(bool include_ms) const {
64 const auto ms_sec = (utc_timestamp_ / 1'000'000) % 1'000;

Callers 2

TEST_FFunction · 0.80
ValueMethod · 0.80

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.64