Palindrome dates: Difference between revisions

Added Easylang
imported>Nmz
(Added Lua section {{header|lua}})
(Added Easylang)
 
(2 intermediate revisions by 2 users not shown)
Line 952:
</pre>
 
 
=={{header|EasyLang}}==
<syntaxhighlight>
t = 1580641200
print "First 15 palindrome dates after 2020-02-02 are:"
repeat
t += 86400
a$ = timestr t
a$[] = strchars substr a$ 1 4 & substr a$ 6 2 & substr a$ 9 2
for i = 1 to 4
if a$[i] <> a$[9 - i]
break 1
.
.
if i = 5
cnt += 1
print substr a$ 1 10
.
until cnt = 15
.
</syntaxhighlight>
 
=={{header|F_Sharp|F#}}==
Line 1,659 ⟶ 1,680:
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{
Line 2,717 ⟶ 2,739:
{{libheader|Wren-fmt}}
{{libheader|Wren-date}}
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Fmt
import "./date" for Date
 
var isPalDate = Fn.new { |date|
2,063

edits