4. Datetime Module#

When working with data, especially with meteorological data, it is a requirement to know and be able to work with dates. As a part of base Python, there is an important module called datetime that contains a number of useful pieces that make working with dates easier. In this chapter we’ll look at some of the most relevant portions of the module that will be utilized throughout this book. One very important is that through this module we can allow the computer to set the current date (or really any date relative to today) for us. In addition, we’ll learn about other tools contained within the module that will allow us to find and set dates as needed to work with various types of data.