UIFlow Guide
设置不同时区,并显示实时时钟到屏幕上(年月日时分秒星期)
from m5stack import *
from m5stack_ui import *
from uiflow import *
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
label0 = M5Label('label0', x=64, y=64, color=0x000, font=FONT_MONT_14, parent=None)
while True:
rtc.settime('ntp', host='cn.pool.ntp.org', tzone=8)
label0.set_text(str(rtc.printRTCtime()))
wait_ms(2)
rtc.settime('ntp', host='cn.pool.ntp.org', tzone=8)
str(rtc.datetime()[0])
str(rtc.datetime()[1])
str(rtc.datetime()[2])
str(rtc.datetime()[3])
str(rtc.datetime()[4)
str(rtc.datetime()[5)
str(rtc.datetime()[6)
rtc.datetime((0, 1, 1, 0, 0, 0, 0, 0))
str(rtc.datetime())
str(rtc.printRTCtime())