parse_date()

parse_date()#

Parses a date string into a structured timestamp and timezone offset. The function supports various date formats and converts them into a standardized format.

Prototype

int parse_date(
    const char *date,
    char *out,
    int outsize
);

Parameters

Key

Type

Description

date

const char *

The input date string to be parsed.

out

char *

Buffer to store the formatted date output.

outsize

int

Size of the output buffer.


Return Value

Returns 0 on success, or -1 if the date string could not be parsed.

Notes

The function supports various date formats, including relative dates like ‘yesterday’ and ‘now’. It converts the parsed date into a standardized format with a timestamp and timezone offset.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples