summaryrefslogtreecommitdiff
path: root/src/mongo/util/time_support.cpp
diff options
context:
space:
mode:
authorXueruiFa <xuerui.fa@mongodb.com>2021-03-17 13:58:23 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-17 14:27:15 +0000
commit191e5b8f0c1b946e0ee785c908da82a14270fa22 (patch)
treeb4bea83cf30233ad831eb06342e8de66ace152d3 /src/mongo/util/time_support.cpp
parenta13cae73d5450b250f62c9e3d1ed40d169f61196 (diff)
downloadmongo-191e5b8f0c1b946e0ee785c908da82a14270fa22.tar.gz
Revert "SERVER-45445 Upgrade third_party/fmt (6.1.1 -> 7.1.3)"
This reverts commit dc68f885b80e70805eab8c5686ee0941bbdd806b.
Diffstat (limited to 'src/mongo/util/time_support.cpp')
-rw-r--r--src/mongo/util/time_support.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/util/time_support.cpp b/src/mongo/util/time_support.cpp
index c00f4e84560..e022d0b4cd0 100644
--- a/src/mongo/util/time_support.cpp
+++ b/src/mongo/util/time_support.cpp
@@ -175,7 +175,9 @@ DateStringBuffer& DateStringBuffer::iso8601(Date_t date, bool local) {
}
{
- auto res = fmt::format_to_n(cur, end - cur, FMT_COMPILE(".{:03}"), date.asInt64() % 1000);
+ static const auto& fmt_str_millis = *new auto(fmt::compile<int32_t>(".{:03}"));
+ auto res = fmt::format_to_n(
+ cur, end - cur, fmt_str_millis, static_cast<int32_t>(date.asInt64() % 1000));
cur = res.out;
dassert(cur < end && res.size > 0);
}
@@ -199,9 +201,10 @@ DateStringBuffer& DateStringBuffer::iso8601(Date_t date, bool local) {
const long tzOffsetMinutesPart = (tzOffsetSeconds / 60) % 60;
// "+hh:mm"
+ static const auto& fmtStrTime = *new auto(fmt::compile<char, long, long>("{}{:02}:{:02}"));
cur = fmt::format_to_n(cur,
localTzSubstrLen + 1,
- FMT_COMPILE("{}{:02}:{:02}"),
+ fmtStrTime,
tzIsWestOfUTC ? '-' : '+',
tzOffsetHoursPart,
tzOffsetMinutesPart)