Skip to content

Instantly share code, notes, and snippets.

@barrachri
Created October 25, 2019 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barrachri/0989bd1935291955ba4aee166743b19b to your computer and use it in GitHub Desktop.
Save barrachri/0989bd1935291955ba4aee166743b19b to your computer and use it in GitHub Desktop.
import datetime as dt
ISO_8601_UTC = "%Y-%m-%dT%H:%M:%S.%fZ"
previous_date = dt.datetime.strptime("2018-09-06T13:34:30.168Z", ISO_8601_UTC)
dt.datetime.utcnow() - previous_date <= dt.timedelta(minutes=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment