Today   (2020-02-02,   at the time of this writing)   happens to be a palindrome,   without the hyphens,   not only for those countries which express their dates in the   yyyy-mm-dd   format but,   unusually,   also for countries which use the   dd-mm-yyyy   format.



Task
Write a program which calculates and shows the next 15 palindromic dates for those countries which express their dates in the   yyyy-mm-dd   format.




with javascript_semantics
include builtins\timedate.e 
sequence res = {}
for d=2021 to 9999 do
    string s = sprintf("%4d",d),
           t = reverse(s)
    s &= "-"&t[1..2]&"-"&t[3..4]
    sequence td = parse_date_string(s, {"YYYY-MM-DD"})
    if timedate(td) then res = append(res,s) end if
end for
printf(1,"Count of palindromic dates [2021..9999]: %d\n\n",length(res))
printf(1,"first 15:\n%s\n",join_by(res[1..15],3,5))
printf(1,"last 15:\n%s\n",join_by(res[-15..-1],3,5))
