KHTTP_DATETIME2EPOCH(3)
π NAME π
okay so bestie, welcome to the KHTTP_DATETIME2EPOCH(3) page from the Library Functions Manual π
β¨
khttp_date2epoch, khttp_datetime2epoch β validate and convert date and time. Periodt.
π LIBRARY π
This one lives in library libkcgi. Slay.
β¨ SYNOPSIS β¨
#include <sys/types.h>
#include <stdarg.h>
#include <stdint.h>
#include <kcgi.h>
int
khttp_date2epoch(int64_t *res, int64_t day, int64_t mon, int64_t year,
int64_t hour, int64_t min, int64_t sec);
int
khttp_datetime2epoch(int64_t *res, int64_t day, int64_t mon,
int64_t year, int64_t hour, int64_t min, int64_t sec);
πΈ DESCRIPTION πΈ
okay so these functions convert broken-day date and time values into seconds since 00:00:00 UTC, 1970-01-01. The date and time values are accepted as UTC. khttp_date2epoch() is equivalent to khttp_datetime2epoch() but with zero hour, min, and sec arguments. If res is NULL, it simply checks the time values for correctness β just a vibe check, no cap.
Date correctness means that input values fall within the following acceptable ranges:
secβ seconds0β59minβ minutes0β59hourβ hours0β23dayβ day of month1β31monβ month1β12yearβ year-2.9e11β2.9e11
The year bound is the maximum year value that may be converted to seconds for a 64-bit integer. big number energy, fr fr.
These deprecate kutil_date2epoch(), kutil_date_check(), kutil_datetime2epoch(), and kutil_datetime_check(), which should no longer be used. do not use the old ones, bestie β theyβre deprecated.
π₯ RETURN VALUES π₯
Return zero if the given values do not correspond to a valid date and time, non-zero otherwise. 0 means invalid, non-zero means valid β donβt flip it.
π¦ SEE ALSO π¦
π AUTHORS π
Written by Kristaps Dzonsons <kristaps@bsd.lv>. iconic.
mwah π β source/version: Debian, date: $Mdocdate$, page name: KHTTP_DATETIME2EPOCH(3). thatβs the whole page, bestie π
π¦ where this page comes from
- alpine 3.24: kcgi-doc 1.0.1-r0 Β· ISC
- Copyright (c) 2020 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms