From c97b1ab2fa27e65e28aff4973adf5396b188d192 Mon Sep 17 00:00:00 2001 From: arofarn Date: Sat, 16 May 2020 09:11:31 +0200 Subject: [PATCH] Add ms to time display when periodically "set_time()" --- code/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/main.py b/code/main.py index 6c42602..986aa8f 100644 --- a/code/main.py +++ b/code/main.py @@ -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)