In this How to Get Tomorrow Date in Python? article, I will show you how to get today’s date, tomorrow’s date and yesterday’s date.
Example :How to Get Tomorrow Date in Python?
from datetime import datetime, timedelta
today = datetime.now()
yesterday = today - timedelta(1)
tomorrow = today + timedelta(1)
print("Yesterday Date :", yesterday.strftime('%d-%m-%Y))
print("Today Date :", today.strftime('%d-%m-%Y))
print("Tomorrow Date :", tomorrow.strftime('%d-%m-%Y))
Output:
Yesterday Date : 28-06-2022
Today Date : 29-06-2022
Tomorrow Date : 30-06-2022
I hope you like this article.
Also Read :
- How to Check if Today is Friday or not in Python?
- Python GET Request with Parameters
- Python POST Request with Parameters Example
- Top 10 VS Code extensions
- Angular Material Grid Layout Example
- Angular Material Card Example
- CSS Profile Card Design