2023年6月15日 星期四

Find the Date on Next Day in Python

# Find the date on next day if today’s date is given by user Find the date on next day# https://www.tutsmake.com/python-program-to-find-the-date-on-a-next-day-if-todays-date-is-given/


import datetime

from datetime import timedelta

d = int(input("Enter the day : "))
m = int(input("Enter the month : "))
y = int(input("Enter the year :"))

# format given date
gDate = datetime.datetime(y, m, d)
print("Given date is : ", gDate)

# Yesterday date
yesterday = gDate + timedelta(days = 1)
print("Next date will be : ", yesterday)

 

沒有留言:

張貼留言

Python program to display calendar

# Python program to display calendar of given month of the year # importing calendar module for calendar operations import calendar # set t...