LOG IN SIGN UP
Documentation

std.time()

Converts a string to a time variable.

The following string formats are supported:

The only time zone supported is GMT.

If the string does not match one of those formats, then the fallback variable is returned instead.

Format

TIME
std.time(STRING s, TIME fallback)

Examples

# var.string will represent: Mon, 02 Jan 2006 22:04:05 GMT
declare local var.string TIME;
set var.string = std.time("Mon, 02 Jan 2006 22:04:05 GMT", std.integer2time(-1));
# var.integer will represent: Mon, 02 Jan 2006 22:04:05 GMT
declare local var.integer TIME;
set var.integer = std.time("1136239445", std.integer2time(-1));
# var.invalid will represent: datetime out of bounds
declare local var.invalid TIME;
set var.invalid = std.time("Not a date", std.integer2time(-1));