Program to find yesterday’s, today’s and tomorrow’s date

from datetime import datetime, timedelta

currentday = datetime.now()

yesterday = currentday - timedelta(1)

tomorrow = currentday + timedelta(1)

print("Yesterday = ", yesterday.strftime('%d-%m-%Y'))

print("Today = ", currentday.strftime('%d-%m-%Y'))

print("Tomorrow = ", tomorrow.strftime('%d-%m-%Y'))


No comments: