Files
WaterTank/test-time.py
2026-06-16 13:02:06 +02:00

9 lines
326 B
Python

import time
import ntptime
tz_offset = 0
utc = time.localtime()
local = time.localtime(time.mktime(utc) + tz_offset * 3600)
ctime = f"{local[0]:02}-{local[1]:02}-{local[2]:02} {local[3]:02}:{local[4]:02}:{local[5]:02}"
#print("Time =", local[0] + '-' + local[1] + '-' + local[2])
#print("Time =", local)
print("Time =", ctime)