LOG IN SIGN UP
Documentation

std.time

Converts a string to a time variable. The following string formats are supported: Sun, 06 Nov 1994 08:49:37 GMT, Sunday, 06-Nov-94 08:49:37 GMT, Sun Nov 6 08:49:37 1994, 784111777.00, 784111777. Useful because time variables are needed as arguments for functions like time.add and strftime.

Comparison operators like > < >= <= == != do not work with std.time or std.integer2time. Instead, you can compare two times using something similar to this:

if (time.is_after(now, std.integer2time(std.atoi("1445445162")))) {
  # do something
}

Format

std.time(string_to_parse, fallback_value)

Examples

set resp.http.X-Seconds-Since-Modified = strftime({"%s"}, time.sub(now, std.time(resp.http.Last-Modified, now)));