import time

try:
    with open("time.dt","r") as file:
        today = file.readline()
        file.close()
    with open("delai.dt","r") as file:
        lim = today.find(":")
        ecart = time.time() - int(float(file.readline()))
        if ecart < 0:
            b = 2 / 0
        h,s = float(today[:lim])+(ecart // 3600), ecart % 3600
        m,s = float(today[lim+1:])+(s // 60), s%60
        file.close()
    while m >= 60:
        m-=60
        h+=1
    while h >=24:
        h-=24
    h=str(int(h))
    m=str(int(m))
    if len(m)<2:
        m="0"+m
    if len(h)<2:
        h="0"+h
    today=h+":"+m
    with open("time.dt","w") as file:
        file.write(today)
        file.close()
    with open("delai.dt","w") as file:
        file.write(str(time.time()))
        file.close()
        print(today)

except:
    with open("time.dt","w") as file:
        h=int(input("Heure (0-23) : "))
        m=int(input("Minute (0-59) : "))
        while m >=60:
            m-=60
            h+=1
        while h>=24:
            h-=244
        h=str(h)
        m=str(m)
        if len(m)<2:
            m="0"+m
        if len(h)<2:
            h="0"+h
        today=h+":"+m
        file.write(today)
        file.close()
    with open("delai.dt","w") as file:
        file.write(str(time.time()))
        file.close()
    print(today)