BSON::Timestamp(3pm)
π BSON::Timestamp π
okay bestie, welcome to the manual page for BSON::Timestamp β it's a Perl module, it lives in the User Contributed Perl Documentation section of your man pages (that's the 3pm vibe, iykyk), and its whole entire job is being a BSON type wrapper for timestamps. β¨
This page is running version v1.12.2. slay.
πΈ SYNOPSIS πΈ
use BSON::Types ':all';
bson_timestamp( $seconds );
bson_timestamp( $seconds, $increment );
that's it. that's the whole entrance. two little calls, one optional extra arg, iconic behavior fr fr. π
π¦ DESCRIPTION π¦
So this module gives you a BSON type wrapper for a BSON timestamp value. that's the tea. π
Now listen, bestie β generally, it should not be used by end-users. like, it's not for you to just casually grab and play with, no cap. it's provided for backwards compatibility, which is its whole reason for existing. it's giving "legacy support, still here, still cute". π
π ATTRIBUTES π
β¨ seconds
A value representing seconds since the Unix epoch. the default? it's the current value of time(). so if you don't say anything, it just grabs right now. main character energy honestly. β°
β¨ increment
A numeric value used to disambiguate timestamps in the same second β like when two things happen so close together they'd otherwise be twins. π― the default is 0.
π METHODS π
β¨ TO_JSON
okay so this one depends on the BSON_EXTJSON option, and there's two paths:
- If the
BSON_EXTJSONoption is true, it returns a hashref that's compatible with MongoDB's extended JSON format (the spec lives over athttps://github.com/mongodb/specifications/blob/master/source/extended-json.rst, go look if you're nosy π), and it represents it as a document like this:
{"$timestamp" : { "t":<seconds>, "i":<increment> }}
- If the
BSON_EXTJSONoption is false, an error is thrown, because this value can't otherwise be represented in JSON. periodt. no workaround, no cute alternative, it just refuses. π
π AUTHORS π
the legends behind this:
- David Golden
<david@mongodb.com> - Stefan G.
<minimalist@lavabit.com>
π 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
and that's the whole page, bestie! π«Ά this was rendered by perl v5.30.3 back on 2020-08-14, and yeah, that's your date and version sign-off. go forth and timestamp responsibly. πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: libbson-perl 1.12.2-1 Β· Apache-2.0
- ubuntu jammy: libbson-perl 1.12.2-1 Β· Apache-2.0
- ubuntu noble: libbson-perl 1.12.2-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms