15 Date and Time
In this chapter, you’ll get to know the Python modules that help you work with time and date information. Python provides two modules for this purpose: time and datetime.
The time module is oriented toward the functions implemented by the underlying C library, while datetime provides an object-oriented interface for working with points in time and time spans.
Note
This chapter is basically intended as a reference. We therefore encourage you to skim it first if you are generally interested and to look into the relevant details in each case if you have specific questions.
In the following sections, we’ll take a closer look at both modules and their functions. To be able to use the time and datetime modules, you must first import ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access