Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get a date up to N days from the date you entered
import datetime
s = input("Date in format yyyy\mm\dd: ").split("\\")
d = datetime.date(int(s[0]),int(s[1]),int(s[2]))
N = input("Diff days: ")
print(d+datetime.timedelta(days=int(N)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment