The datetime module turns dates into objects you can read, shift, compare and format — no manual month-counting.
1 Fixed Dates First
date(2025, 1, 15) builds a date you choose — no dependence on today while you learn.
2 Dates Are Objects
One date object carries year, month and day — read each part with dot access.
3 Math on the Calendar
Add or subtract timedelta durations; Python handles month and year rollovers.
4 Text on Demand
strftime turns any date into exactly the text format you need.
Calendar math, minus the headaches
Fixed Dates First1date(2025, 1, 15) builds a date you choose — no dependence on today while you learn. Dates Are Objects2One date object carries year, month and day — read each part with dot access. Math on the Calendar3Add or subtract timedelta durations; Python handles month and year rollovers.
Text on Demand4strftime turns any date into exactly the text format you need. 4 building blocks make up Calendar math, minus the headaches
Press Run to watch a single date travel from construction to formatted text.
A fixed release date gets read, formatted, pushed 17 days ahead and compared.
maindate and timedelta live in the datetime module — part of the standard library.
Memory
no variables yet — press play
Console
output appears as the program runs…
Click a term, then click its description to lock the pair.
5 conceptsTap a card to expand ?date(2025, 1, 15)drops into place
?timedelta(days=7)drops into place
?d.strftime("%B")drops into place
?d.yeardrops into place
?d2 > d1drops into place
A flight, a two-day trip, and a format to read it back.
Your predicted output — one line per console line
Hint: March has 31 days, so the 28th plus 2 lands on March 30. %d/%m prints day then month, zero-padded.
01date(2025, 1, 15) constructs a fixed date: year, month, day — in that order.
02timedelta(days=n) is a duration; date + timedelta gives a new date.
03Comparisons work across dates: later dates are greater.
04strftime("%B %d") formats; %Y, %m and %d are the numeric building blocks.
05Fixed dates keep examples and tests reproducible — avoid datetime.now() while learning.