perldoc > BSON::Time

🧭 NAME

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

🚀 Quick Reference

Use CaseCommandDescription
Create timestamp for nowbson_time()Returns a BSON::Time object representing the current UTC time
Create from Unix epoch secondsbson_time( $secs )Accepts floating‑point seconds since epoch
Get seconds since epoch$time->epochFloating‑point seconds (milliseconds ÷ 1000)
ISO‑8601 string$time->as_iso8601YYYY-MM-DDThh:mm:ss.sssZ format
Convert to DateTime$time->as_datetimeLoads and returns a DateTime object
Convert to DateTime::Tiny$time->as_datetime_tinyLightweight alternative
Convert to Time::Moment$time->as_time_momentFast, immutable time object
Stringify / numify"$time", 0+$timeOverloads return epoch value

🔖 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

🛠️ 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 🛠️ 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:10 @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_^