Skip to content

mess822_date.3

Manvendra Bhangui edited this page Feb 25, 2024 · 5 revisions

NAME

mess822_date - print a timestamp in RFC 822 format

SYNTAX

#include <mess822.h>

int mess822_date(&sa,&t);

stralloc sa;
mess822_time t;

DESCRIPTION

mess822_date takes the timestamp in t and puts it into sa in RFC 822 format. It returns 1 on success, 0 if it runs out of memory.

See http://pobox.com/~djb/proto/immhf/date.html for a description of the RFC 822 timestamp format. Typical example:

   16 Aug 1998 15:09:01 -0000

The timestamp in t has the following structure. If t*.known*** is 0 then there is no timestamp; mess822_date prints an empty string. If t*.known*** is 1 then t*.ct*** contains a date and time in UTC in struct caltime format, with no information about the timestamp creator's time zone. If t*.known*** is 2 then t*.ct*** contains a date and time in the timestamp creator's time zone.

mess822_date can tolerate out-of-range numbers for month, day, hour, minute, second, and zone, though in this case it no longer guarantees that its output will make sense.

mess822_date can handle years from 1900 through at least 2000000000.

SEE ALSO

caltime(3), mess822(3), mess822_when(3),

Clone this wiki locally