module BSON::Time::ClassMethods
Public Instance Methods
Source
# File lib/bson/time.rb, line 115 def from_bson(buffer, **options) seconds, fragment = Int64.from_bson(buffer, mode: nil).divmod(1000) at(seconds, fragment * 1000).utc end
Deserialize UTC datetime from BSON
.
@param [ ByteBuffer
] buffer The byte buffer.
@option options [ nil | :bson ] :mode Decoding mode to use.
@return [ Time
] The decoded UTC datetime.
@see bsonspec.org/#/specification
@since 2.0.0