module BSON::Date

def bson_type

As the date is converted to a time, this returns the BSON type for time.

Get the BSON type for the date.
def bson_type
  ::Time::BSON_TYPE
end

def to_bson(buffer = ByteBuffer.new)

Other tags:
    Since: - 2.1.0

Other tags:
    See: http://bsonspec.org/#/specification -

Returns:
  • (BSON::ByteBuffer) - The buffer with the encoded object.

Other tags:
    Example: Get the date as encoded BSON. -
def to_bson(buffer = ByteBuffer.new)
  buffer.put_int64((jd - DATE_REFERENCE) * MILLISECONDS_IN_DAY)
end