t2timestamp()

t2timestamp()#

t2timestamp() converts a given time value into a formatted timestamp string, supporting both local and UTC time representations.

Prototype

char *t2timestamp(
    char *bf,
    int bfsize,
    time_t t,
    BOOL local
);

Parameters

Key

Type

Description

bf

char *

Buffer to store the formatted timestamp.

bfsize

int

Size of the buffer to ensure safe string formatting.

t

time_t

Time value to be converted into a timestamp.

local

BOOL

Flag indicating whether to use local time (TRUE) or UTC (FALSE).


Return Value

Returns a pointer to the formatted timestamp string stored in bf.

Notes

The function uses strftime() to format the timestamp in ISO 8601 format with timezone information.

Prototype

// Not applicable in JS

Prototype

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