Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to subtract dates in Python

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)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #subtract #dates #Python
ADD COMMENT
Topic
Name
3+5 =