epoch
Returns the number of seconds since the epoch (i.e. a floating-point value).
as_iso8601
Returns the "value" as an ISO-8601 formatted string of the form "YYYY-MM-DDThh:mm:ss.sssZ". The
fractional seconds will be omitted if they are zero.
as_datetime
Loads DateTime and returns the "value" as a DateTime object.
as_datetime_tiny
Loads DateTime::Tiny and returns the "value" as a DateTime::Tiny object.
as_mango_time
Loads Mango::BSON::Time and returns the "value" as a Mango::BSON::Time object.
as_time_moment
Loads Time::Moment and returns the "value" as a Time::Moment object.
TO_JSON
Returns a string formatted by "as_iso8601".
If the "BSON_EXTJSON" option is true, it will instead be compatible with MongoDB's extended JSON
<https://github.com/mongodb/specifications/blob/master/source/extended-json.rst> format, which represents
it as a document as follows:
If the "BSON_EXTJSON" environment variable is true and the "BSON_EXTJSON_RELAXED" environment variable is
false, returns a hashref compatible with MongoDB's extended JSON
<https://github.com/mongodb/specifications/blob/master/source/extended-json.rst> format, which represents
it as a document as follows:
{"$date" : { "$numberLong": "22337203685477580" } }
If the "BSON_EXTJSON" and "BSON_EXTJSON_RELAXED" environment variables are both true, then it will return
a hashref with an ISO-8601 string for dates after the Unix epoch and before the year 10,000 and a
$numberLong style value otherwise.
{"$date" : "2012-12-24T12:15:30.500Z"}
{"$date" : { "$numberLong": "-10000000" } }