- All Courses
- Python Foundations for Data Work
- Files, APIs, and the Standard Library
- Dates, paths, and the standard library
Lesson 3.3
Dates, paths, and the standard library
Datetimes come in naive and aware flavours, and mixing them raises an error at the worst moment.
35mBeginner18.3k students
Overview
Most of what you need already ships with Python
Datetimes come in naive and aware flavours, and mixing them raises an error at the worst moment. Store and compute in UTC, convert to a local zone only for display, and the entire category of bug disappears.
Path objects replace string concatenation for filesystem work. Joining, extension changes, and existence checks all become methods, and the result is correct on every platform.
Before adding a dependency, check the standard library. Grouping, permutations, temporary files, and configuration parsing are all already there.
In this lesson you will:
- Handle time zones without guessing
- Build file paths that work anywhere
- Reach for the standard library first
Resources
Notes are not saved yet — they clear when you leave this page.
Previous Lesson
Calling HTTP APIs
7m
DataFrames and Series
31m