KHTTP_EPOCH2DATETIME(3)

πŸ“¦ version 1.0.1, in alpine 3.24

πŸŽ€ khttp_epoch2datetime(3) πŸŽ€

okay so bestie, this little icon is from the Library Functions Manual, and the main character is literally khttp_epoch2datetime πŸ’…

πŸ’– NAME πŸ’–

khttp_epoch2datetime β€” convert time to components ✨

πŸ“š LIBRARY πŸ“š

library β€œlibkcgi” 🫢

✨ SYNOPSIS ✨

#include <sys/types.h>
#include <stdarg.h>
#include <stdint.h>
#include <kcgi.h>

void
khttp_epoch2datetime(int64_t epoch, int64_t *sec, int64_t *min,
    int64_t *hour, int64_t *mday, int64_t *mon, int64_t *year,
    int64_t *wday, int64_t *yday);

🧚 DESCRIPTION 🧚

So what it does is format an epoch value β€” that’s seconds since Jan 1, 1970, 00:00:00 UTC β€” into its broken-down time components. The components get filled in like this, no cap:

  • sec β€” seconds 0–59 ⏱️
  • min β€” minutes 0–59 πŸ•°οΈ
  • hour β€” hours 0–23 🌞
  • day β€” day of month 1–31 πŸ“…
  • mon β€” month 1–12 🌸
  • year β€” year -2.9e11–2.9e11 🀯
  • yday β€” day in year 0–365 πŸ—“οΈ
  • wday β€” day in week 0–6 (Sunday = 0) 🌈

If any of the pointers are NULL, they are ignored β€” super chill, no drama πŸ™ˆ

For broken-down time values suitable for struct tm, see khttp_epoch2tms(3) πŸ‘€

πŸ‘€ SEE ALSO πŸ‘€

🫢 AUTHORS 🫢

Written by Kristaps Dzonsons <kristaps@bsd.lv> πŸ’œ


xoxo, signing off from Debian with the date stamp $Mdocdate$ and the title KHTTP_EPOCH2DATETIME(3) β€” slay πŸ’…πŸ’–

πŸ“¦ where this page comes from
  • alpine 3.24: kcgi-doc 1.0.1-r0 Β· ISC
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms