2023-07-01 11:58:00 -04:00
|
|
|
// [dependencies]
|
2026-04-30 12:34:36 -04:00
|
|
|
// chrono = "0.4.44"
|
2023-07-01 11:58:00 -04:00
|
|
|
|
|
|
|
|
fn is_palindrome(s: &str) -> bool {
|
|
|
|
|
s.chars().rev().eq(s.chars())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
2026-04-30 12:34:36 -04:00
|
|
|
let mut date = chrono::Utc::now().date_naive();
|
2023-07-01 11:58:00 -04:00
|
|
|
let mut count = 0;
|
|
|
|
|
while count < 15 {
|
|
|
|
|
if is_palindrome(&date.format("%Y%m%d").to_string()) {
|
|
|
|
|
println!("{}", date.format("%F"));
|
|
|
|
|
count += 1;
|
|
|
|
|
}
|
2026-04-30 12:34:36 -04:00
|
|
|
date = date.succ_opt().unwrap();
|
2023-07-01 11:58:00 -04:00
|
|
|
}
|
|
|
|
|
}
|