from dateutil.relativedelta import relativedelta
from datetime import datetime
dt=datetime.today()
print("Today:",dt) # current date and time
print(" No of days left for New year")
dt2=datetime(dt.year+1,1,1,0,0,0) # Date and time for new year
dt3=relativedelta(dt2,dt) # time left for new year
print("Years:", dt3.years, ", Months:",dt3.months, "Dayes:",dt3.days,
",Hours :",dt3.hours,", Minutes :",dt3.minutes, ", Seconds :",dt3.seconds)
Output
Today: 2021-12-27 17:04:00.848590
No of days left for New year
Years: 0 , Months: 0 Dayes: 4 ,Hours : 6 , Minutes : 55 , Seconds : 59
Displaying Countdown time for new year using Tkinter windowAuthor
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.