timeToUnixTime

Given a timestamp, if it belongs to a set of supported formats, return the equivalent unix timestamp. Refer to the 'DateConversion' enum for the list of supported formats.

To call C functions used for the conversion safely, the input string needs to be null-terminated. Fortunately the format is clearly defined, so we can just copy the input string into a fixed-length buffer.

bool
timeToUnixTime

Parameters

str cstring

string containing the timestamp to be converted

time time_t

a time_t that is filled with the result of the conversion

conversion_type DateConversion

if the timestamp was converted from one of the supported formats, then set the type of conversion used

Return Value

Type: bool

true if the timestamp was successfully converted

Meta