Skip to content

Instantly share code, notes, and snippets.

View FrazzIe's full-sized avatar

Fraser Watt FrazzIe

View GitHub Profile
@markuman
markuman / unixtime.lua
Created August 6, 2015 16:49
date string to unixtime in redis with lua
local function YearInSec(y)
-- returns seconds of a year
if ((y % 400) == 0) or (((y % 4) == 0) and ((y % 100) ~= 0)) then
return 31622400 -- 366 * 24 * 60 * 60
else
return 31536000 -- 365 * 24 * 60 * 60
end
end