13 lines
No EOL
421 B
Lua
13 lines
No EOL
421 B
Lua
local date = require "date"
|
|
-- prints all FRIDAY the 13TH dates between year 2000 and 2010
|
|
for i = 2000, 2010 do
|
|
-- year jan 1
|
|
x = date(i, 1, 1)
|
|
-- from january to december
|
|
for j = 1, 12 do
|
|
-- set date to 13, check if friday
|
|
if x:setmonth(j, 13):getweekday() == 6 then
|
|
print(x:fmt("%A, %B %d %Y"))
|
|
end
|
|
end
|
|
end |