Chapter 29: Dates, Time and Scheduling
Complete Python lesson for very beginners. Technical words are explained in simple language, and every outline topic includes a practical example, expected output, steps, and practice.
Chapter Overview
This Python tutorial chapter covers Dates, Time and Scheduling through 15 connected topics. Work through the examples in order, check the expected output, and complete the practice after each topic.
- 29.1 datetime
- 29.2 Dates
- 29.3 Times
- 29.4 Date-Time Objects
- 29.5 Formatting Dates
- Plus 10 additional Python topics in this chapter.
29.1 datetime
datetime is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import datetime
now = datetime(2026, 9, 21, 10, 30)
print(now.year, now.month, now.day)Expected Output
2026 9 21Step-by-Step Explanation
- Import datetime.
- Create a known date-time value.
- Read individual fields such as year, month, and day.
29.2 Dates
Dates is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
29.3 Times
Times is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
29.4 Date-Time Objects
Date-Time Objects is part of Dates, Time and Scheduling. In simple language, it means a value with data and behavior.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
29.5 Formatting Dates
Formatting Dates is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
29.6 Parsing Dates
Parsing Dates is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
29.7 timedelta
timedelta is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date, timedelta
d = date(2026, 9, 21)
print(d + timedelta(days=7))Expected Output
2026-09-28Step-by-Step Explanation
- Create a date.
- Create a seven-day duration.
- Add the duration to the date.
29.8 Time Zones
Time Zones is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import datetime, timezone
now = datetime(2026, 9, 21, 12, 0, tzinfo=timezone.utc)
print(now.isoformat())Expected Output
2026-09-21T12:00:00+00:00Step-by-Step Explanation
- Create an aware datetime with UTC.
- Time-zone-aware values carry offset information.
- isoformat() produces a standard text representation.
29.9 UTC
UTC is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import datetime, timezone
now = datetime(2026, 9, 21, 12, 0, tzinfo=timezone.utc)
print(now.isoformat())Expected Output
2026-09-21T12:00:00+00:00Step-by-Step Explanation
- Create an aware datetime with UTC.
- Time-zone-aware values carry offset information.
- isoformat() produces a standard text representation.
29.10 zoneinfo
zoneinfo is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import datetime, timezone
now = datetime(2026, 9, 21, 12, 0, tzinfo=timezone.utc)
print(now.isoformat())Expected Output
2026-09-21T12:00:00+00:00Step-by-Step Explanation
- Create an aware datetime with UTC.
- Time-zone-aware values carry offset information.
- isoformat() produces a standard text representation.
29.11 Unix Timestamps
Unix Timestamps is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
29.12 Measuring Time
Measuring Time is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
29.13 time Module
time Module is part of Dates, Time and Scheduling. In simple language, it means a Python file that can provide reusable code.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
import math
print(math.sqrt(81))Expected Output
9.0Step-by-Step Explanation
- import makes a module available.
- Use module.name to access its contents.
- The standard-library math module provides sqrt().
29.14 Calendar Operations
Calendar Operations is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
29.15 Scheduling Concepts
Scheduling Concepts is part of Dates, Time and Scheduling. In simple language, it means a Python idea used while learning dates, time and scheduling.
It is one building block of dates, time and scheduling and helps you write clearer, more predictable Python programs. For a very beginner, focus first on what goes in, what Python does, and what comes out; details become easier after you run a small example.
Python / Practical Example
from datetime import date
print(date(2026,9,21))Expected Output
2026-09-21Step-by-Step Explanation
- Read the example from top to bottom.
- Identify the value, object, or operation related to this topic.
- Change one small input and predict the result before running it.
Common Beginner Mistakes
- Copying code without predicting what each line does.
- Ignoring the first useful error message or traceback location.
- Mixing tabs/spaces or changing indentation accidentally.
- Using data of the wrong type for an operation.
- Trying to learn many advanced variations before mastering one small working example.
Chapter Practice
- Choose three topics from this chapter and re-type their examples without copying and pasting.
- For each example, change one input and predict the output first.
- Explain five technical terms from this chapter in your own beginner-friendly words.
- Create one small program that combines at least two chapter topics.
- Keep notes about errors you made and what fixed them.
Mini Project / Challenge
Create a small Python exercise that combines at least three ideas from Dates, Time and Scheduling. Start with a tiny working version, test it, then improve it one step at a time.
- Choose three topics from this chapter.
- Write or adapt a small Python example using those topics.
- Predict the output before running the code.
- Test at least one different input.
- Write two sentences explaining what the program does and what you learned.
20 Questions & Answers
1. What is the main goal of Chapter 29?
The goal is to understand dates, time and scheduling through small explanations, examples, and practice.
2. Should I memorize every command or method?
No. Understand the pattern, practice the common form, and learn how to read documentation when you need exact details.
3. Why are the examples small?
Small examples isolate one idea at a time, which makes errors easier to understand and fix.
4. What should I do when an example gives an error?
Read the last part of the traceback, check spelling and indentation, confirm the required package or file exists, and compare the input types with what the operation expects.
5. Why should I predict output before running code?
Prediction forces you to reason about the program instead of only copying it.
6. What should I remember about datetime?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
7. What should I remember about Dates?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
8. What should I remember about Times?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
9. What should I remember about Date-Time Objects?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
10. What should I remember about Formatting Dates?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
11. What should I remember about Parsing Dates?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
12. What should I remember about timedelta?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
13. What should I remember about Time Zones?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
14. What should I remember about UTC?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
15. What should I remember about zoneinfo?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
16. What should I remember about Unix Timestamps?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
17. What should I remember about Measuring Time?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
18. What should I remember about time Module?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
19. What should I remember about Calendar Operations?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.
20. What should I remember about Scheduling Concepts?
Remember its beginner meaning, the problem it helps solve, the shape of a small example, and one common situation where it is appropriate.