Skip to content

Instantly share code, notes, and snippets.

@mvgolom
Created October 27, 2018 21:58
Show Gist options
  • Select an option

  • Save mvgolom/814480d622fb1b3027d11065bbfb70cd to your computer and use it in GitHub Desktop.

Select an option

Save mvgolom/814480d622fb1b3027d11065bbfb70cd to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import datetime
dat1 = '1994-10-08T23:14:05Z'
dat2 = str(datetime.datetime.date(datetime.datetime.now()))
dat1f = dat1.split("T")[0]
d1 = datetime.datetime.strptime(dat1f, "%Y-%m-%d")
d2 = datetime.datetime.strptime(dat2, "%Y-%m-%d")
quantidade_dias = abs((d2 - d1).days)
print(quantidade_dias)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment