ParseTime Function

Parses a string representing a date and/or time into a unix timestamp. The timezone is always interpreted as UTC/GMT.

See this URL for valid parameters: https://en.cppreference.com/w/cpp/io/manip/get_time

Note that available parameters depends on support from your operating system. In particular, ones highlighted in yellow on that page are not currently available on Windows and should be avoided for portable plugins.

int ParseTime(const char[] dateTime, const char[] format)

Parameters

const char[] dateTime

Date and/or time string.

const char[] format

Formatting rules (passing NULL_STRING will use the rules defined in sm_datetime_format).

Return Value

32bit timestamp (number of seconds since unix epoch).

Errors

Invalid date/time string or time format.