Date and Time Data types for Analysis
You may be familiar with dates and times, but do you know how these quantitative measures are represented? They are represented using numbers, but not a single number. Instead, they are measured with a set of numbers, with one number each for year, month, day, hour, minute, second, and millisecond.
This is a complex representation, comprising several different components. For example, knowing the current minute without knowing the current hour does not serve any purpose. Additionally, there are complex ways of interacting with dates and times; for example, different points in time can be subtracted from one another. The current time can be represented differently depending on where you are in the world.
As a result of these intricacies, you need to take special care when working with this type of data. In fact, PostgreSQL, like most databases, offers special data types that can represent these types of values. You will start by examining...