openhatmony 5.0.1 时间同步的情况下,关闭WIFI网络并修改日期和时间,恢复网络后时间和日期不同步

openhatmony 5.0.1 时间同步的情况下,关闭WIFI网络并修改日期和时间,恢复网络后时间和日期不同步
您需要先 登录 才能评论/回答

全部评论(6)
1.获取下persist.time.synctimefromntp,这个需要为true
param get persist.time.synctimefromntp
2.确保当前网络可以访问时钟同步服务器
ping ntp.aliyun.com

2025-05-20 13:56:06
--------------正确时间-------------- # param get |grep "persist.time." persist.time.timezone = Asia/Shanghai persist.time.ntpserver = ntp.aliyun.com persist.time.ntpserver_specific = persist.time.auto_time = ON persist.time.synctimefromntp = true persist.time.auto_restore_timer_apps = # cat proc/driver/rtc rtc_time : 07:58:21 rtc_date : 2025-05-20 alrm_time : 14:49:00 alrm_date : 2025-04-13 alarm_IRQ : no alrm_pending : no update IRQ enabled : no periodic IRQ enabled : no periodic IRQ frequency : 1 max user IRQ frequency : 64 24hr : yes # # # # ping ntp.aliyun.com Ping ntp.aliyun.com (203.107.6.88): 56(84) bytes. 64 bytes from 203.107.6.88: icmp_seq=1 ttl=51 time=77 ms 64 bytes from 203.107.6.88: icmp_seq=2 ttl=51 time=78 ms 64 bytes from 203.107.6.88: icmp_seq=3 ttl=51 time=81 ms --- 203.107.6.88 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss round-trip min/avg/max = 77/78/81 ms # # # # # ----------------------关闭wifi---修改为非当前日期---打开wifi并连接上热点-------------------- /bin/sh: ------------------------------------------: inaccessible or not found # # # ping ntp.aliyun.com Ping ntp.aliyun.com (203.107.6.88): 56(84) bytes. 64 bytes from 203.107.6.88: icmp_seq=1 ttl=51 time=679 ms 64 bytes from 203.107.6.88: icmp_seq=2 ttl=51 time=78 ms 64 bytes from 203.107.6.88: icmp_seq=3 ttl=51 time=69 ms --- 203.107.6.88 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss round-trip min/avg/max = 69/275/679 ms # cat proc/driver/rtc rtc_time : 19:50:35 rtc_date : 2026-04-27 alrm_time : 14:49:00 alrm_date : 2025-04-13 alarm_IRQ : no alrm_pending : no update IRQ enabled : no periodic IRQ enabled : no periodic IRQ frequency : 1 max user IRQ frequency : 64 24hr : yes #

原本获取不到persist.time.synctimefromntp;设置系统参数后并重新打开wlan热点连接后可以还是 ping ntp.aliyun.com;但时间还是不对

