laptop on brown sofa
Photo by XPS on Unsplash

If you use Python in your work, or simply for scripting, chances are that there will come a point in time when you are going to need to work with dates.

Since we still live in this universe where time passes, we may need to find the number of days that have passed between one point and another one.

We can of course pull up a calendar and manually count the days, which is slow and boring.

To do that quickly, we can import the date module in our Python script and initially prepare the dates:

After that, we can basically just find the difference between 2 numbers:

Yes, it’s that simple.

You do not have to spend hours doing it manually on a physical calendar. It can take barely seconds to do it like this.

I hope this helps you out.