Skip to content

Instantly share code, notes, and snippets.

@jmccardle
Created January 9, 2023 13:38
Show Gist options
  • Save jmccardle/e5d5c04267b32edb17f53de5054b3268 to your computer and use it in GitHub Desktop.
Save jmccardle/e5d5c04267b32edb17f53de5054b3268 to your computer and use it in GitHub Desktop.
from datetime import date, timedelta
def eight_digit_date(d: str):
return all([str(x) in d for x in range(8)])
valid_dates = []
d = date(year=2000, day=1, month=1)
while d.year < 2100:
if eight_digit_date(d.isoformat()): valid_dates.append(d)
d += timedelta(days=1)
print(len(valid_dates))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment