formatdate()

formatdate()#

Format a timestamp into a human-readable date string.

Prototype

PUBLIC char *formatdate(
    double      timestamp,
    const char  *format
);
        

Parameters

Key

Type

Description

timestamp

double

The timestamp to format, in seconds since the epoch.

format

const char *

The format string for the date (e.g., "%Y-%m-%d %H:%M:%S").


Return Value

Returns a string containing the formatted date, or NULL on failure. The caller is responsible for freeing the string.

Prototype

// Not applicable in JS

Prototype

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