diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2017-12-26 22:49:36 -0500 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2017-12-29 11:25:07 -0500 |
commit | e304b58275d36a1c28d0e652582268c070f599b7 (patch) | |
tree | 2140c64e08586c1e53130a21485eed5cfb0ac73d /src/mongo/util/time_support.cpp | |
parent | d6eab87cb1792ecea387bb35e14a797f0e639770 (diff) | |
download | mongo-e304b58275d36a1c28d0e652582268c070f599b7.tar.gz |
SERVER-29335 fix millisecond formatting
Diffstat (limited to 'src/mongo/util/time_support.cpp')
-rw-r--r-- | src/mongo/util/time_support.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/util/time_support.cpp b/src/mongo/util/time_support.cpp index e19843ca473..4f106663cab 100644 --- a/src/mongo/util/time_support.cpp +++ b/src/mongo/util/time_support.cpp @@ -204,8 +204,10 @@ void _dateToCtimeString(Date_t date, DateStringBuffer* result) { ctime_r(&t, result->data); #endif char* milliSecStr = result->data + ctimeSubstrLen; - snprintf( - milliSecStr, millisSubstrLen + 1, ".%03d", static_cast<int32_t>(date.asInt64() % 1000)); + snprintf(milliSecStr, + millisSubstrLen + 1, + ".%03u", + static_cast<unsigned>(date.toMillisSinceEpoch() % 1000)); result->size = ctimeSubstrLen + millisSubstrLen; } } // namespace |