BSON_ITER_DATE_TIME(3)

πŸ’… BSON_ITER_DATE_TIME(3) β€” libbson, bestie

ok so first things first: this is a page from libbson, section 3 of the manual, and it's about the teeniest little helper ever β€” checking whether an iterator is holding a date-time, and then actually grabbing that date-time. it's giving "small but essential." πŸŽ€


✨ SYNOPSIS ✨

here's the whole thing, copied exactly, no notes:

#define BSON_ITER_HOLDS_DATE_TIME(iter) \
   (bson_iter_type ((iter)) == BSON_TYPE_DATE_TIME)

int64_t
bson_iter_date_time (const bson_iter_t *iter);

so you get a macro and a function. two for one. we love a bundle. 🫢


🌸 PARAMETERS 🌸

  • iter β€” a bson_iter_t. that's it. that's the whole list. one (1) parameter, main character energy. πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bson_iter_date_time() shall return the number of milliseconds since the UNIX epoch β€” and it gets that number from the element it's sitting on, which has to be a BSON_TYPE_DATE_TIME element. πŸ•°οΈ

like, it's literally just handing you the milliseconds that were already chillin' in there. no math, no drama, no cap. ✨


⭐ RETURNS ⭐

a 64-bit integer (int64_t, bb) containing the number of milliseconds since the UNIX epoch. that's the vibe check result. πŸ’–


πŸŽ€ AUTHOR πŸŽ€

MongoDB, Inc β€” iconic, honestly.


2009-present, MongoDB, Inc. β€” they've been at it for a minute fr fr.


bestie reminder: the function is bson_iter_date_time() and the macro is BSON_ITER_HOLDS_DATE_TIME(iter) β€” don't mix 'em up, you'd be surprised 😭

okay that's the whole page!! version 2.5.6, dated Oct 09, 2026 β€” which is, like, so soon. mark your calendars, slay, periodt πŸ’…πŸ”₯

πŸ“¦ where this page comes from