...

/

Puzzle 21: Explanation

Puzzle 21: Explanation

Let’s learn how the datetime module works in Python.

We'll cover the following...

Try it yourself

Try executing the code below to verify the result:

Press + to interact
from datetime import datetime
date = datetime(10_000, 1, 1)
print(f'The party started on {date:%B, %d %Y} and lasted a 10 days')

Explanation

Computers and time have a complicated relationship. There are daylight saving time changes, leap years, ...