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_EPOCH2STR(3) FreeBSD Library Functions Manual KHTTP_EPOCH2STR(3)

khttp_epoch2str, khttp_epoch2ustr
convert time to a string

library “libkcgi”

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

char *
khttp_epoch2str(int64_t epoch, char *buf, size_t sz);

char *
khttp_epoch2ustr(int64_t epoch, char *buf, size_t sz);

Format an epoch value (seconds since Jan 1, 1970, 00:00:00 UTC) into the buffer buf of size sz, which should be greater than or equal to 64 bytes. If not enough space is given for the formatted date, the buffer is truncated to the available size. It is always NUL-terminated.

The output of khttp_epoch2str() conforms to RFC 5322 (“Wed, 02 Oct 2002 13:00:00 GMT”). However, the year may be greater than four digits or less than 1900, or even be negative, which is contrary to RFC 5322 section 3.3.

khttp_epoch2ustr() conforms to ISO 8601 (“2002-10-02T13:00:00Z”), again with the stipulation that the year may be greater than 4 digits or be less than zero.

These deprecate the original kutil_epoch2str() and kutil_epoch2utcstr() functions, which had undefined behaviour in some corner cases.

Returns a pointer to the input buf or NULL if buf is NULL, sz is zero, or time conversion fails.

khttp_datetime2epoch(3), khttp_epoch2datetime(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.