module BSON::Time

Injects behaviour for encoding and decoding time values to and from raw bytes as specified by the BSON spec.

@note

Ruby time can have nanosecond precision:
+Time.utc(2020, 1, 1, 0, 0, 0, 999_999_999/1000r)+
+Time#usec+ returns the number of microseconds in the time, and
if the time has nanosecond precision the sub-microsecond part is
truncated (the value is floored to the nearest millisecond).
MongoDB only supports millisecond precision; we truncate the
sub-millisecond part of microseconds (floor to the nearest millisecond).
Note that if a time is constructed from a floating point value,
the microsecond value may round to the starting floating point value
but due to flooring, the time after serialization may end up to
be different than the starting floating point value.
It is recommended that time calculations use integer math only.

@see bsonspec.org/#/specification

@since 2.0.0