Python Date Snippets

The Python snippet collection contains helper functions for Python 3.6. It includes utilities for most common data types, such as primitivies, lists, dictionaries and date objects.

  • Date range

    Creates a list of dates between start (inclusive) and end (not inclusive).

    Python, Date · Jan 7, 2021

  • Date from ISO format

    Converts a date from its ISO-8601 representation.

    Python, Date · Jan 7, 2021

  • Date to ISO format

    Converts a date to its ISO-8601 representation.

    Python, Date · Jan 7, 2021

  • Date difference in months

    Calculates the month difference between two dates.

    Python, Date · Oct 28, 2020

  • Days ago

    Calculates the date of n days ago from today.

    Python, Date · Oct 28, 2020

  • Date difference in days

    Calculates the day difference between two dates.

    Python, Date · Oct 28, 2020

  • Days from now

    Calculates the date of n days from today.

    Python, Date · Oct 28, 2020

  • Date is weekday

    Checks if the given date is a weekday.

    Python, Date · Nov 2, 2020

  • Date is weekend

    Checks if the given date is a weekend.

    Python, Date · Nov 2, 2020

  • Add days to date

    Calculates the date of n days from the given date.

    Python, Date · Oct 28, 2020