From ec3ddcb9886e3c74b78aa8521bc05e695f6aeeab Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 25 Apr 2019 12:41:19 -0500 Subject: [PATCH] include/utime: make gmtime() output conformant ISO 8601 Use 'T' separated instead of ' '. Signed-off-by: Sage Weil --- src/include/utime.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/utime.h b/src/include/utime.h index 0a6f48d5230..b6d6cbe804b 100644 --- a/src/include/utime.h +++ b/src/include/utime.h @@ -241,14 +241,14 @@ public: out << (long)sec() << "." << std::setw(6) << usec(); } else { // this looks like an absolute time. - // aim for http://en.wikipedia.org/wiki/ISO_8601 + // conform to http://en.wikipedia.org/wiki/ISO_8601 struct tm bdt; time_t tt = sec(); gmtime_r(&tt, &bdt); out << std::setw(4) << (bdt.tm_year+1900) // 2007 -> '07' << '-' << std::setw(2) << (bdt.tm_mon+1) << '-' << std::setw(2) << bdt.tm_mday - << ' ' + << 'T' << std::setw(2) << bdt.tm_hour << ':' << std::setw(2) << bdt.tm_min << ':' << std::setw(2) << bdt.tm_sec; @@ -270,14 +270,14 @@ public: out << (long)sec() << "." << std::setw(6) << usec(); } else { // this looks like an absolute time. - // aim for http://en.wikipedia.org/wiki/ISO_8601 + // conform to http://en.wikipedia.org/wiki/ISO_8601 struct tm bdt; time_t tt = sec(); gmtime_r(&tt, &bdt); out << std::setw(4) << (bdt.tm_year+1900) // 2007 -> '07' << '-' << std::setw(2) << (bdt.tm_mon+1) << '-' << std::setw(2) << bdt.tm_mday - << ' ' + << 'T' << std::setw(2) << bdt.tm_hour << ':' << std::setw(2) << bdt.tm_min << ':' << std::setw(2) << bdt.tm_sec; -- 2.39.5