BSON::Time - BSON type wrapper for date and time
version v1.2.2
use BSON::Types ':all'; bson_time( $number );
This module provides a BSON type wrapper for a 64-bit date-time value in the form of milliseconds since the Unix epoch (UTC only).
On a Perl without 64-bit integer support, the value must be a Math::BigInt object.
A integer representing milliseconds since the Unix epoch. The default is 0.
Returns the number of seconds since the epoch (i.e. a floating-point value).
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.
value
YYYY-MM-DDThh:mm:ss.sssZ
Loads DateTime and returns the value as a DateTime object.
Loads DateTime::Tiny and returns the value as a DateTime::Tiny object.
Loads Mango::BSON::Time and returns the value as a Mango::BSON::Time object.
Loads Time::Moment and returns the value as a Time::Moment object.
Returns a string formatted by "as_iso8601".
If the BSON_EXTJSON option is true, it will instead be compatible with MongoDB's extended JSON format, which represents it as a document as follows:
BSON_EXTJSON
{"$date" : { "$numberLong": "22337203685477580" } }
Both numification (0+) and stringification ("") are overloaded to return the result of "epoch". Numeric comparison and string comparison are overloaded based on those and fallback overloading is enabled.
0+
""
David Golden <david@mongodb.com>
Stefan G. <minimalist@lavabit.com>
This software is Copyright (c) 2016 by Stefan G. and MongoDB, Inc.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install BSON, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BSON
CPAN shell
perl -MCPAN -e shell install BSON
For more information on module installation, please visit the detailed CPAN module installation guide.