Given date-time D, write a program to print the time left for the next New Year.
import datetime
d = datetime.datetime(*[int(_) for _ in input('Input date and time (year, month, day, hours, minutes, seconds separated by space): ').split(" ")])
next_new_year = datetime.datetime(d.year + 1, 1, 1, 0, 0, 0)
delta = next_new_year - d
print("Time until next New Year: ", delta)
Comments
Leave a comment