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.




 
load "stdlib.ring"
 
dt		= 0
num		= 0
limit	        = 15
 
? "First 15 palindromic dates:" + nl
 
while num < limit
 
	dt++
	dateStr  = adddays(date(),dt)
	newDate  = substr(dateStr,7,4) + substr(dateStr,4,2) + substr(dateStr,1,2)
	newDate2 = substr(dateStr,7,4) + "-" + substr(dateStr,4,2) + "-" + substr(dateStr,1,2)
	if ispalindrome(newDate)
                num++
		? newDate2 	
	ok
	if num > limit
		exit
	ok
 
end
 