diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-05-07 16:45:29 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-05-12 09:57:33 -0400 |
commit | 9aac625685811873ffbc2d3e8d09531eff1ce10e (patch) | |
tree | ecd8dd9fc9d148b196c6ab2aa5e38e5f9e327c54 /src/mongo/bson/oid.cpp | |
parent | 21a16d229bdba571f1118a419898b666c666b869 (diff) | |
download | mongo-9aac625685811873ffbc2d3e8d09531eff1ce10e.tar.gz |
SERVER-13874 Make mongo::Milliseconds et al. aliases for equivalent stdx::chrono types.
Also introduces operators for adding stdx::chrono::duration to Date_t,
subtracting two Date_ts to get Milliseconds, and remove the use of
reinterpret_cast from the implementation of BSON Timestamp type.
Diffstat (limited to 'src/mongo/bson/oid.cpp')
-rw-r--r-- | src/mongo/bson/oid.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/bson/oid.cpp b/src/mongo/bson/oid.cpp index 853299d5bfe..e9c6b87eb3a 100644 --- a/src/mongo/bson/oid.cpp +++ b/src/mongo/bson/oid.cpp @@ -151,7 +151,7 @@ namespace { } void OID::init(Date_t date, bool max) { - setTimestamp(uint32_t(date / 1000)); + setTimestamp(uint32_t(date.toMillisSinceEpoch() / 1000)); uint64_t rest = max ? std::numeric_limits<uint64_t>::max() : 0u; std::memcpy(_view().view(kInstanceUniqueOffset), &rest, kInstanceUniqueSize + kIncrementSize); |