Im programming with PYTHON...
I have two diferent dates...and I want to know the difference (in days) between them. The format of the date is YYYY-MM-DD
To explain myself in a better way...
I have a function that can ADD or SUBSTRACT a given number and get the date....for example:
ret = time.strftime("%Y-%m-%d",time.localtime(time.mktime(time.strptime(a,"%Y-%m-%d"))+x*3600*24+3600))
- to get the difference between two
datetime objects and take the
from datetime import datetime def days_between(d1, d2): d1 = datetime.strptime(d1, "%Y-%m-%d") d2 = datetime.strptime(d2, "%Y-%m-%d") return abs((d2 - d1).days)