Palindrome dates: Difference between revisions
Content added Content deleted
Alpha bravo (talk | contribs) (Added AutoHotkey) |
|||
Line 348: | Line 348: | ||
9280-08-29 |
9280-08-29 |
||
9290-09-29</pre> |
9290-09-29</pre> |
||
=={{header|AutoHotkey}}== |
|||
<lang AutoHotkey>date := 20200202 |
|||
counter := 0 |
|||
while (counter < 15) { |
|||
date += 1, days |
|||
date := SubStr(date, 1, 8) |
|||
if (date = reverse(date)) |
|||
{ |
|||
FormatTime, fdate, % date, yyyy-MM-dd |
|||
output .= fdate "`n" |
|||
counter++ |
|||
} |
|||
} |
|||
MsgBox, 262144, , % output |
|||
return |
|||
reverse(n){ |
|||
for i, v in StrSplit(n) |
|||
output := v output |
|||
return output |
|||
}</lang> |
|||
{{out}} |
|||
<pre> |
|||
2021-12-02 |
|||
2030-03-02 |
|||
2040-04-02 |
|||
2050-05-02 |
|||
2060-06-02 |
|||
2070-07-02 |
|||
2080-08-02 |
|||
2090-09-02 |
|||
2101-10-12 |
|||
2110-01-12 |
|||
2111-11-12 |
|||
2120-02-12 |
|||
2121-12-12 |
|||
2130-03-12 |
|||
2140-04-12 |
|||
</pre> |
|||
=={{header|AWK}}== |
=={{header|AWK}}== |