Skip to content

Commit 9ceae2b

Browse files
committed
fix set_time add monkey patch, see micropython esp32 issues.
1 parent 38a8f8b commit 9ceae2b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

12.network/zhiwu.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
def set_time(secs):
55
import time
66
import machine
7-
machine.RTC().init(time.localtime(secs))
7+
8+
# monkey patch
9+
tmp = list(time.localtime(secs))
10+
tmp.insert(3, 0)
11+
tmp.pop()
12+
# print(tmp)
13+
14+
# print(time.time())
15+
machine.RTC().datetime(tmp)
16+
# print(time.time())
817

918
# import ntptime
1019
# time.settime()

0 commit comments

Comments
 (0)