Dates and times are something every programmer eventually has to deal with. Python's implementation is fairly simple and simplifies these often tricky subjects.
What you'll learn
- Dates and times
- Timezones
- Converting between timezones
Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.
Dates and times are something every programmer eventually has to deal with. Python's implementation is fairly simple and simplifies these often tricky subjects.
Let's look at the datetime library and its datetime class. We'll also see how to manipulate these objects, turn them into strings, and more.
Chevron 11 steps6:50
4 objectives
4:39
4 questions
1 objective
4:06
1 objective
7:28
2 objectives
4:35
1 objective
To make sure we understand datetimes and timedeltas, let's build a small app that'll time us answering math questions.
Chevron 6 steps7:09
1 objective
7:38
1 objective
4:49
1 objective
Expand the script so that:
Timezones are often an amazingly confusing part of programming. Let's make them simpler using datetime and the pytz library.
Chevron 8 steps5:07
3 objectives
2 objectives
8:59
2 objectives
7:52
1 objective
6 questions
Get personalized course recommendations, track subjects and courses with reminders, and more.