fmt_httpdate(3)
π fmt_httpdate β the group chat's favorite date printer π
okay so real talk, this page lives in the Library Functions Manual, section 3, and its whole name is fmt_httpdate(3). she's a library function, she's iconic, and she has exactly one job: turning a time_t into the exact ASCII date format that HTTP is obsessed with. no cap. π
β¨ NAME β¨
fmt_httpdate β write a date in ASCII as in the HTTP protocol π¦
πΈ SYNTAX πΈ
#include <libowfat/fmt.h>
size_t fmt_httpdate(char *dest,time_t source);
bestie look at that signature, it's giving "two arguments, zero drama" π
π DESCRIPTION π
so fmt_httpdate writes a date in the ASCII representation that the HTTP protocol defines, and it looks exactly like this:
Sun, 06 Nov 1994 08:49:37 GMT
that's the vibe. that's the format. that string is literally the whole personality of this function. β
heads up:fmt_httpdatedoes not append\0. she does not terminate your string for you. the null byte is your problem, not hers. π
and here's the cute little trick she does π§ β if dest equals FMT_LEN (i.e. is zero), then fmt_httpdate returns the number of bytes it would have written. so you can literally ask her "how much room do I need, queen?" before committing to anything. no guessing. we love a function that respects your buffer. π«Ά
also: the output of fmt_httpdate is 29 until Jan 1st 10000. twenty-nine bytes of pure date realness, and she's holding that length for a very long time. π
okay that's the whole page, mwah π
this lil sign-off is brought to you by the footer, which honestly just says fmt_httpdate(3) again β section 3, Library Functions Manual, no extra version or date tea to spill. she said "my name is enough." and honestly? she's right. periodt. πβ¨
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- 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