We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f73017e commit 52207ebCopy full SHA for 52207eb
1 file changed
emp_utils.py
@@ -109,4 +109,13 @@ def wrapper(*args, **kwargs):
109
110
return wrapper
111
112
-
+def sync_time():
113
+ import urequests
114
+ from machine import RTC
115
+ rtc = RTC()
116
+ print('before sync: ', rtc.datetime())
117
+ time = urequests.get('http://www.1zlab.com/api/get-time/').json()
118
+ # print(time)
119
+ rtc.init(tuple(time['rtc']))
120
+ print('after sync: ', rtc.datetime())
121
+
0 commit comments