Category date

How to Add Days to a Date in Python

Python provides a built-in module called datetime to manipulate dates and times. In a previous post, we say how to extract the year from a date using this module (the same logic can be used for days and months, by…

Extract the Year from a Date in Python

In a previous post, we explained how we can convert a string to a date object in Python. When you perform this action, it is often because you need to generate some kind of summary statistics, by year for instance.…

How to convert a string to a date in Python

Python comes with the datetime library to manipulate date and times. One of the most common manipulation we want to achieve is to convert a string representing a date to a real date object. By doing so, we’d be able…