Palindrome dates: Difference between revisions

m
→‎Lua: day>0 cond unnecessary
imported>Nmz
(Added Lua section {{header|lua}})
imported>Nmz
m (→‎Lua: day>0 cond unnecessary)
Line 1,659:
local monthS, dayS = yearS:reverse():match"^(%d%d)(%d%d)$"
local monthN, dayN = tonumber(monthS), tonumber(dayS)
dateS = yearS .. "-" .. monthS .. "-" .. dayS
until
monthN>0 and monthN<=12 -- real month
and dayN>0 and dayN<32 -- possible day
and os.date( -- real date check
-- be aware that this check is unnecessary because it only affects the 13th century
"%Y-%m-%d"
,os.time{
Anonymous user