BSON_APPEND_TIME_T(3)
π BSON_APPEND_TIME_T π
okay so bestie, welcome to the libbson manual page for BSON_APPEND_TIME_T(3) β yes that's the whole title, yes it's a lot of caps, we love her for it β¨. Pull up a chair, this one's actually a little shortcut macro and it's kind of iconic.
πΈ SYNOPSIS πΈ
here's the whole vibe, exactly as written, don't come for me:
#define BSON_APPEND_TIME_T(b, key, val) \
bson_append_time_t (b, key, (int) strlen (key), val)
bool
bson_append_time_t (bson_t *bson,
const char *key,
int key_length,
time_t value);
so you've got the macro on top β she's the shortcut β and the real function underneath doing the actual work π«Ά.
π PARAMETERS π
every single one of these matters, no skipping:
bsonβ abson_t. that's your doc, your canvas, your main character πkeyβ an ASCII C string with the name of the field. like, what you're calling this thingkey_lengthβ the length ofkeyin bytes, or-1if you want it to just figure out the length withstrlen()π₯ (ngl-1is the move most of the time)valueβ atime_t. yeah. that's it. that's the value
π¦ DESCRIPTION π¦
okay so this is the part where it gets good: the bson_append_time_t() function is a helper that takes a time_t instead of milliseconds since the UNIX epoch. that's literally the whole pitch π like, you've got a time_t lying around and you don't wanna do the conversion math yourself, so you hand it to her and she handles it. slay.
β RETURNS β
she returns true if the operation was applied successfully π.
careful bestie β the function will fail if appending the value growsbsonlarger thanINT32_MAX. that's the hard limit, no cap, she is not going past it π
π AUTHOR π
MongoDB, Inc β periodt π«‘
π COPYRIGHT π
2009-present, MongoDB, Inc. β protect her at all costs π
and that's the page!! shoutout to libbson version 2.5.6, dated Oct 09, 2026 β she's stamped, sealed, and delivered πβ¨ go append some timestamps bestie, you've got this π
π¦ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms