BSON::Timestamp(3pm)

πŸ“¦
version 1.12.2 Β· 5 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– 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:

{"$timestamp" : { "t":<seconds>, "i":<increment> }}
  • If the BSON_EXTJSON option 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>

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