You could use TIMEDELTA to increase or decrease date value.
from datetime import datetime, timedelta
print (datetime.today() + timedelta(days=(1))).strftime('%Y-%m-%d') // for next day
print (datetime.today() + timedelta(days=(-1))).strftime('%Y-%m-%d') // for previous day
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 12/16/14, 2:19 AM|
|Seen: 627 times|
|Last updated: 3/16/15, 8:10 AM|