Standard C++ Library Reference ISO/IEC (VERSION3)
localtime
struct tm *localtime(const time_t *tod);
The function stores in the static-duration time structure an encoding of the calendar time in *tod, expressed as
local time. It returns the address of that structure.
mktime
time_t mktime(struct tm *tptr);
The function alters the values stored in *tptr to represent an equivalent encoded local time, but with the
values of all members within their normal ranges. It then determines the values tptr->wday and
tptr->yday from the values of the other members. It returns the calendar time equivalent to the encoded
time, or it returns a value of -1 if the calendar time cannot be represented.
NULL
#define NULL <either 0, 0L, or (void *)0> [0 in C++]
The macro yields a null pointer constant that is usable as an address constant expression.
size_t
typedef ui-type size_t;
The type is the unsigned integer type ui-type of an object that you declare to store the result of the sizeof
operator.
strftime
size_t strftime(char *s, size_t n,
const char *format, const struct tm *tptr);
The function generates formatted text, under the control of the format format and the values stored in the time
structure *tptr. It stores each generated character in successive locations of the array object of size n whose
first element has the address s. The function then stores a null character in the next location of the array. It
returns x, the number of characters generated, if x < n; otherwise, it returns zero, and the values stored in the
array are indeterminate.
For each multibyte character other than % in the format, the function stores that multibyte character in the array
object. Each occurrence of % followed by an optional qualifier and another character in the format is a
conversion specifier. The optional qualifiers [added with C99] are:
E, to represent times in terms of a locale-specific era (such as 1 BC instead of 0000).●
O, to represent numeric values with a set of locale-specific alternate digits (such as first instead of 1).●
For each conversion specifier, the function stores a replacement character sequence.
The following table lists all conversion specifiers defined for strftime. The fields used in *tptr follow.
Example replacement character sequences in parentheses follow each description. All examples are for the "C"
locale, which ignores any optional qualifier, using the date and time Sunday, 2 December 1979 at 06:55:15 AM