Marche plus car je suis en train de changer ma façon de gérer l'horloge

This commit is contained in:
Christian Zufferey
2020-08-15 12:56:17 +02:00
parent 94ffe17fcc
commit a86ea289b5
4 changed files with 49 additions and 75 deletions

View File

@@ -0,0 +1,19 @@
-- Scripts pour régler l'horloge quand on est connecté en WIFI
print("\n set_time2.lua zf200815.1255 \n")
function set_time()
sntp.sync(nil, nil, nil, 1)
end
function ztime()
tm = rtctime.epoch2cal(rtctime.get()+2*3600)
print(string.format("%04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"]))
end
set_time()
--[[
print(ztime())
]]