Parse Datetime Strings with parsedatetime in Python

Introduction In this tutorial, we’ll take a look at how to parse Datetime with parsedatetime in Python. To use the parsedatetime package we first need to install it using pip: $ pip install parsedatetime Should pip install parsedatetime fail, the package is also opensource available on Github. Convert String to Python’s Datetime Object with parsedatetime The first, and most common way to use parsedatetime is to parse a string into a datetime object. First, you’ll want to import the parsedatetime […]

Read more

Python: Get Number of Days Between Dates

Introduction In this tutorial, we’ll take a look at how to get the number of days between two dates in Python. We’ll be using the built-in datetime package, that allows you to really easily work with datetime objects in Python. Creating a Datetime Object As datetime is a built-in module, you can access it right away by importing it at the top of your Python file. You can construct datetime objects in a few different ways: from datetime import datetime […]

Read more