Dates and times look simple until you try to calculate with them. Months have different lengths, years are sometimes leap years, clocks change for daylight saving, and the same moment has a different time on each side of the world. Python’s datetime module handles most of this, and the time and calendar modules cover the rest. This lesson shows you how to make, change, format, parse and compare dates and times, and the rules that keep you out of trouble.
More lessons in Complete Python Programming