I figured it out, I'll have to have a go at working with leap years.
I know you can get the time like this:
local a = tick() local hour = math.floor(a/60/60%24) local minute = math.floor(a/60%60) local second = math.floor(a%60)
But what's the math to calculate the date?