parse_expiry_date()

parse_expiry_date()#

Parses a date string and converts it into a timestamp. Special keywords like never, all, and now are handled explicitly.

Prototype

int parse_expiry_date(
    const char *date,
    timestamp_t *timestamp
);

Parameters

Key

Type

Description

date

const char *

A string representing the date to be parsed. Can be a standard date format or special keywords like never, all, or now.

timestamp

timestamp_t *

Pointer to a variable where the parsed timestamp will be stored.


Return Value

Returns 0 on success, or a nonzero value if an error occurs during parsing.

Notes

If the date string is never, the function sets timestamp to 0. If date is all or now, timestamp is set to the maximum possible value (TIME_MAX). Otherwise, it attempts to parse the date using approxidate_careful().

Prototype

// Not applicable in JS

Prototype

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