Injects behaviour for encoding date time values to raw bytes as specified by the BSON spec for time.
@see bsonspec.org/#/specification
@since 2.1.0
Get the date time as encoded BSON.
@example Get the date time as encoded BSON.
DateTime.new(2012, 1, 1, 0, 0, 0).to_bson
@return [ String ] The encoded string.
@see bsonspec.org/#/specification
@since 2.1.0
# File lib/bson/date_time.rb, line 37 def to_bson(encoded = ''.force_encoding(BINARY)) to_time.to_bson(encoded) end
Generated with the Darkfish Rdoc Generator 2.