We have to run this script to get the time left for new year. To display a countdown timer showing Hours Minutes and seconds left can be shown by using Tkitner.
After the time, on the new year, we can also show the Happy New Year message.
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