current_timestamp()

current_timestamp()#

Generates a timestamp string with nanosecond precision in ISO 8601 format, including the local timezone offset.

Prototype

char *current_timestamp(
    char *bf,
    size_t bfsize
);

Parameters

Key

Type

Description

bf

char *

Buffer to store the generated timestamp. Must be at least 90 bytes long.

bfsize

size_t

Size of the buffer in bytes.


Return Value

Returns a pointer to the buffer bf containing the formatted timestamp string.

Notes

The function uses clock_gettime(CLOCK_REALTIME, &ts) to obtain the current time with nanosecond precision and formats it as YYYY-MM-DDTHH:MM:SS.nnnnnnnnn±hhmm.

Prototype

// Not applicable in JS

Prototype

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