in your browser.
Day of the Year
Return to board index
local day = date("%j")
One simple question:
How does this handle leap years?
Does it shift the whole sequence one step forward, or is it always shifted but skips 29th of feb when it's not a leap year?
It's an alias to Lua's os.date, which means the time value it optionally takes in is the number of seconds that have elapsed since 1/1/1970. It just does the math to determine day, month, and year from that.
In other words, it should figure it out just fine.
Note: I haven't personally tested it, so you may want to confirm that it does this in 2016
You are not logged in. Please
to post a reply or
if you don't already have an account.