fmt_iso8601(3)
fmt_iso8601(3) π
okay bestie, welcome to the fmt_iso8601 page from the Library Functions Manual β this one's a lil baby, it's literally just "turn a timestamp into a cute string" and honestly? iconic for it. no cap. π
β¨ NAME β¨
fmt_iso8601 β write a date in ASCII conforming to ISO-8601 π¦
πΈ SYNTAX πΈ
#include <libowfat/fmt.h>
size_t fmt_iso8601(char *dest,time_t source);
like, that's the whole vibe. two args, one dream. π
π DESCRIPTION π
so fmt_iso8601 writes a date in ASCII, exactly the way ISO-8601 defines it, and it looks like this:
"2014-05-27T19:22:16Z"
that's it, that's the format. π β¨
ngl, ISO-8601 also allows you to store a sub-second part and a time zone, but fmt_iso8601 does not support that. it's giving minimalist. it's giving "we don't do that here". π
also, real talk:fmt_iso8601does not append\0. so don't come for it expecting a null terminator, bestie, it's not gonna happen. π
here's the lil party trick though β if dest equals FMT_LEN (i.e. is zero), then fmt_iso8601 returns the number of bytes it would have written. so you can ask it "how much room do i need?" and it just tells you, no drama. π
and the return value of fmt_iso8601 is 20 until Jan 1st 10000. yes, twenty. until the year ten thousand. she's consistent. she's committed. periodt. β
that's genuinely the whole page, bestie β short, sweet, and exactly 20 bytes of timestamp energy. go forth and format. π«Ά
mwah π this has been fmt_iso8601(3) straight outta the Library Functions Manual β thanks for scrolling with me, ily, drink water, and remember: no null terminator, no problem. π§π
π¦ where this page comes from
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms