UUID_TIME(3)
π UUID_TIME(3) π
okay so first things first, bestie: this is uuid_time(3), from the section 3 manual pages (that's the library-call section, iykyk). buckle up, we're doing time archaeology on UUIDs β¨
πΈ NAME πΈ
uuid_time β it pulls out the exact moment your UUID was born π like a birthday but for a 128-bit identifier
π¦ SYNOPSIS π¦
#include <uuid.h>
time_t uuid_time(const uuid_t uu, struct timeval *ret_tv)
that's it. that's the whole vibe. two args, one timestamp, zero drama π
β¨ DESCRIPTION β¨
so uuid_time() extracts the time at which the time-based UUID you handed it β uu β was created. literally pulling the birthday out of the ID. no cap.
but β and this is the important part, so pay attention bestie π β the UUID creation time is only encoded within certain types of UUIDs. it's not in all of them, it's not a universal thing, it's a "some UUIDs came with the timestamp baked in" situation.
so this function can only reasonably expect to extract the creation time for UUIDs that were created with uuid_generate_time(3) and uuid_generate_time_safe(3). those two, yes. those are the ones that behave.
with UUIDs created by other mechanisms? it may or may not work. and that "may or may not" is doing a LOT of heavy lifting, so like... don't come for this function when it doesn't give you what you want π it warned you fr fr
β RETURN VALUE β
you get the time at which the UUID was created, in seconds since January 1, 1970 GMT β that's the epoch, bestie, the big bang of Unix time β returned as your return value (see time(2)). π₯
and there's a bonus: the same creation time, but in seconds and microseconds since the epoch, also gets stored in the location pointed to by ret_tv (see gettimeofday(2)). so you get the seconds twice, once plain and once with the microsecond garnish. we love a two-for-one π«Ά
π AUTHORS π
Theodore Y. Tsβo β the icon who wrote this, we stan π
π SEE ALSO π
uuid(3)uuid_clear(3)uuid_compare(3)uuid_copy(3)uuid_generate(3)uuid_is_null(3)uuid_parse(3)uuid_unparse(3)
the whole UUID friend group, all linked up π§
π REPORTING BUGS π
found a bug? no gatekeeping, go report it β use the issue tracker at <https://github.com/util-linux/util-linux/issues>. the maintainers want to hear from you, fr fr π
π AVAILABILITY π
the libuuid library is part of the util-linux package since version 2.15.1. you can download it from the Linux Kernel Archive at <https://www.kernel.org/pub/linux/utils/util-linux/>. go get it, bestie π
okay that's the whole thing!! this page is util-linux 2.41.6, dated 2026-08-31, and honestly? iconic. periodt. ππ¦β¨
π¦ where this page comes from
- alpine 3.22: util-linux-doc 2.41.6-r1 Β· GPL-3.0-or-later AND GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-only AND LGPL-2.1-or-later AND BSD-1-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND MIT AND Public-Domain
- alpine 3.23: util-linux-doc 2.41.6-r1 Β· GPL-3.0-or-later AND GPL-2.0-or-later AND GPL-2.0-only AND GPL-1.0-only AND LGPL-2.1-or-later AND BSD-1-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND MIT AND Public-Domain
- fedora 43: libuuid-devel 2.41.6-1.fc43 Β· BSD-3-Clause AND LGPL-2.1-or-later
- fedora 43: libuuid-devel 2.41.6-1.fc43 Β· BSD-3-Clause AND LGPL-2.1-or-later
- fedora 44: libuuid-devel 2.41.6-1.fc44 Β· BSD-3-Clause AND LGPL-2.1-or-later
- fedora 44: libuuid-devel 2.41.6-1.fc44 Β· BSD-3-Clause AND LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms