Add ms to time display when periodically "set_time()"

This commit is contained in:
arofarn 2020-05-16 09:11:31 +02:00
parent b7a3387c5f
commit c97b1ab2fa

View File

@ -285,6 +285,7 @@ while True:
time_to_test = rtc.datetime()
if time_to_test[5] + time_to_test[6] == 0: # (chaque heure quand min et sec = 0)
print("Old Time: {0:04d}/{1:02d}/{2:02d}_{4:02d}:{5:02d}:{6:02d}.{7}".format(*time_to_test))
print("Old Time: {0:04d}/{1:02d}/{2:02d}_{4:02d}:{5:02d}:{6:02d}.{7:03d}".format(*time_to_test))
set_rtc()
print("Time set: {0:04d}/{1:02d}/{2:02d}_{4:02d}:{5:02d}:{6:02d}.{7}".format(*rtc.datetime()))
print("Time set: {0:04d}/{1:02d}/{2:02d}_{4:02d}:{5:02d}:{6:02d}.{7:03d}".format(*rtc.datetime()))
time.sleep(1)