Skip to content

Commit e1fec18

Browse files
committed
add set time.
1 parent 6b2f868 commit e1fec18

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

06.clock/set_time.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import time
2+
import machine
3+
4+
t = list(time.localtime(94534523))
5+
t.insert(3, 0)
6+
t.pop()
7+
print(t)
8+
9+
rtc = machine.RTC()
10+
11+
print(rtc.datetime(t))
12+
print(rtc.datetime())
13+
14+
15+
print(time.time())
16+
17+
18+
#
19+
# # print(time.time())
20+
# t1 = time.localtime(546450051)
21+
# print(t1)
22+
# tm.datetime(t1)
23+
# print(tm.datetime())
24+
# t2 = time.maketime(time.localtime(546450052))
25+
# print(t2)
26+
# tm.datetime(t2)
27+
# print(tm.datetime())
28+
29+
# print(time.time())

0 commit comments

Comments
 (0)