I had the idea to make a Countup from a Date with days, month and years and I want to show the countup on a small screen with a raspberry pi or something like that. How can I generate a loop etc. to update the numbers on screen (e. g. every hour)?
Here is the code I wrote:
import time
now = time.localtime()
day=now.tm_mday
month=now.tm_mon
year=now.tm_year
hour=now.tm_hour
minute=now.tm_min
summer=now.tm_isdst
print("Tag:", day)
print("Monat:", month)
print("Jahr:", year)
if month<4:
j=year-2020
elif month==4:
if day<4:
j=year-2020
else:
j=year-2019
else:
j=year-2019
if month<4:
m=month+7
elif month==4:
if day<7:
m=month+7
elif day>=7:
m=0
else:
m=month-4
else:
m=month-4
if day<7:
t=day+24
elif day==7:
t=0
else:
t=day-7
print(j , ":" , m , ":" , t)
The Timer should work from the 7th of april 2020.