diff options
Diffstat (limited to 'src/mongo/bson/bsonelement.h')
-rw-r--r-- | src/mongo/bson/bsonelement.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h index c4fd19c77b4..25d9e895b49 100644 --- a/src/mongo/bson/bsonelement.h +++ b/src/mongo/bson/bsonelement.h @@ -211,7 +211,8 @@ namespace mongo { @see Bool(), trueValue() */ Date_t date() const { - return Date_t(ConstDataView(value()).read<LittleEndian<unsigned long long>>()); + return Date_t::fromMillisSinceEpoch( + ConstDataView(value()).read<LittleEndian<long long>>()); } /** Convert the value to boolean, regardless of its type, in a javascript-like fashion @@ -464,7 +465,7 @@ namespace mongo { Date_t timestampTime() const { unsigned long long t = ConstDataView(value() + 4).read<LittleEndian<unsigned int>>(); - return t * 1000; + return Date_t::fromMillisSinceEpoch(t * 1000); } unsigned int timestampInc() const { return ConstDataView(value()).read<LittleEndian<unsigned int>>(); |