GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
KHTTP_DATETIME2EPOCH(3) FreeBSD Library Functions Manual KHTTP_DATETIME2EPOCH(3)

khttp_date2epoch, khttp_datetime2epoch
validate and convert date and time

library “libkcgi”

#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);

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, simply check the time values for correctness.

Date correctness means that input values fall within the following acceptable ranges:

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

The year bound is the maximum year value that may be converted to seconds for a 64-bit integer.

These deprecate kutil_date2epoch(), kutil_date_check(), kutil_datetime2epoch(), and kutil_datetime_check(), which should no longer be used.

Return zero if the given values do not correspond to a valid date and time, non-zero otherwise.

khttp_epoch2datetime(3), khttp_epoch2str(3), khttp_epoch2tms(3)

Written by Kristaps Dzonsons <kristaps@bsd.lv>.
June 12, 2022 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.