Working with Date and Time Objects
Computers are complex machines that can, among many other things, record date and time. The world is so attached to the measurement of time that it drives a great part of our daily lives. We work within a time interval, we are supposed to go to school for a determinate minimum number of years, and even the value of our work is calculated based on time. Likewise, the business world is also run by the wheel of time. This is evident because of the popular saying: time is money.
Dates and times are just like other types of data, holding valuable information and good business insights if you know how to handle them. During a data exploration that involves a datetime
variable, questions such as What is the busiest month, day, and hour? Which days of the week have more traffic? or How much was the revenue in the past 3 months? will arise, and we must know how to deal with those objects to facilitate better analysis.
There are three main ways to work...