September 2026
1051 pages
35h 4m
English
The datetime module is more abstract than the time module—and also more convenient to use due to its own time and date types.
Four data types are provided (see Table 15.5), which we’ll describe individually in the following sections.
|
Data Types of datetime |
Section |
|
|---|---|---|
|
date |
A data type for storing dates. |
|
|
time |
Saves points in time for a specific day. |
|
|
datetime |
The combination of datetime.date and datetime.time to store times that include both a date and a time. |
|
|
timedelta |
It’s possible to create differences between datetime.date and datetime.datetime instances. The results of such subtractions are datetime.timedelta objects. ... | |
Read now
Unlock full access