Is there any simple way to convert a RFC HTTP date into a timestamp in Lua?
\"Sat, 29 Oct 1994 19:43:31 GMT\"
into
783467011
If you need to convert the value to a unix timestamp, the code to do so would be this:
-- Assuming a date pattern like: yyyy-mm-dd hh:mm:ss
local pattern = "(%d+)-(%d+)-(%d+) (%d+):(%d+):(%d+)"
local timeToConvert = "2011-01-01 01:30:33"
local runyear, runmonth, runday, runhour, runminute, runseconds = timeToConvert:match(pattern)
local convertedTimestamp = os.time({year = runyear, month = runmonth, day = runday, hour = runhour, min = runminute, sec = runseconds})