Palindromic dates are dates that appear as palindromes: the string of digits can be read the same way backwards as forwards. For the North American date format (MM/DD/YYYY), the next few palindromic dates are:
Create a function that returns all palindromic dates in a consistent, common date format (of your choosing) that fall within a range of dates (edit: including the range itself).
- To qualify as a palindrome, only the numeric characters of the date should be checked.
- The date can be in any common format (
DD-MM-YYYY), as long as it uses two digits for both the month and day and four for the year, and it uses a character to separate parts of the date. The output must preserve seperating characters (
-, etc.). Your function only needs to handle one distinct date format. Please include the format in your answer.
- If there are more than one dates returned, they should be comma or new-line separated.
- Shortest answer wins!
date_palindrome('05/02/2050', '12/12/2060') >>>['05/02/2050', '06/02/2060']