In addition to the standard data types of integer, float, Boolean, and string we often need to keep track and do mathematics with date and time values. Python has several modules to manipulate them, but the one we will be covering is datetime.

Objectives

Upon completion of this chapter’s exercises, you should be able to:

  • Explain Coordinated Universal Time (UTC) and the use of time zones.
  • Calculate locale time from UTC and UTC from a locale’s time.
  • Express dates and times in the ISO Format and be able to explain all parts of an ISO date-time string.
  • Discuss the difference between aware and naive date-times in Python.
  • Use dates and times in a Python program.
  • Change between an ISO string and a Python date time.

Download PDF of Chapter