man > BSON::Time

๐Ÿ“› NAME

BSON::Time - BSON type wrapper for date and time

๐Ÿš€ Quick Reference

Use CaseCommandDescription
๐Ÿ•’ Current timebson_time()Create BSON::Time for right now
๐Ÿ“… From timestampbson_time($secs)Create from floatingโ€‘point seconds since epoch
โฑ๏ธ Get epoch seconds$t->epochReturns seconds as a float
๐ŸŒ ISOโ€‘8601 string$t->as_iso8601Formatted like YYYY-MM-DDThh:mm:ss.sssZ
๐Ÿ“† DateTime object$t->as_datetimeConvert to DateTime
๐Ÿ“Œ DateTime::Tiny$t->as_datetime_tinyConvert to DateTime::Tiny
๐Ÿฅญ Mango::BSON::Time$t->as_mango_timeConvert for Mango driver
โŒ› Time::Moment$t->as_time_momentConvert to Time::Moment
๐Ÿ“ค JSON serialisation$t->TO_JSONISOโ€‘8601 or extended JSON (respects env vars)
โž• Numification / stringification0+$t or "$t"Returns epoch seconds (float)

๐Ÿ“ฆ VERSION

version v1.12.2

๐Ÿ“‹ SYNOPSIS

use BSON::Types ':all';

bson_time();        # now
bson_time( $secs ); # floating point seconds since epoch

๐Ÿ“– DESCRIPTION

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.

๐Ÿท๏ธ ATTRIBUTES

๐Ÿ”น value

A integer representing milliseconds since the Unix epoch. The default is 0.

๐Ÿ”ง METHODS

โš–๏ธ OVERLOADING

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.

๐Ÿ‘ฅ AUTHORS

๐Ÿ“œ COPYRIGHT AND LICENSE

This software is Copyright (c) 2020 by Stefan G. and MongoDB, Inc.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004
BSON::Time
๐Ÿ“› NAME ๐Ÿš€ Quick Reference ๐Ÿ“ฆ VERSION ๐Ÿ“‹ SYNOPSIS ๐Ÿ“– DESCRIPTION ๐Ÿท๏ธ ATTRIBUTES
๐Ÿ”น value
๐Ÿ”ง METHODS โš–๏ธ OVERLOADING ๐Ÿ‘ฅ AUTHORS ๐Ÿ“œ COPYRIGHT AND LICENSE

Generated by phpman v4.9.25-4-g0d844aa · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-07 09:06 @216.73.217.93
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format

^_top_^