Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    Yuzuki Lizard V851S开发板 –获取正确的本地时间

    V Series
    2
    6
    2621
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bayche
      bayche LV 6 last edited by

      • 本文转载自:https://forums.100ask.net/t/topic/3031
        (群友Blev提供)

      获取正确的本地时间

      要使用 ntpdate 功能,那么要在menuconfig中编译ntpdate 否则板子是找不到这个功能的。

      1、进入 menuconfig
      然后找到 Network ,然后是 时间同步

      *号模块 ntpclient 和 ntpdate

      5cf177e5664d78ce9ea40955a533fc2d387a4277.png

      2、进入终端连上wifi,同步时间

      执行

      ntpdate 0.pool.ntp.org
      
      ntpdate ntp.aliyun.com
      

      检查获取到的时间 date

      此时会发现获取到的时间与北京时间相差8小时。

      3、添加模块zoneinfo,然后修改时区

      1、
      8266025f1b43619d259f04bd0ca4228014f82d6a.png

      2、
      07510f145e146a283e35346873131e7dc5b6b053.jpeg

      此时再进入终端,会发现zoneinfo已经出来了。
      62279a3f13bd652c068b772565e0f173e42b5628.png

      3、设定为当地时间:

      ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
      

      最终按照此教程,成功更新时间。

      1 Reply Last reply Reply Quote Share 0
      • A
        Ary_Ye LV 5 last edited by

        大佬,出现Error resolving ntp.aliyun.com: Unrecognized service (-8)怎么解决呢?能ping通ntp.aliyun.com
        QQ截图20230624111102.png

        bayche 1 Reply Last reply Reply Quote Share 0
        • bayche
          bayche LV 6 @Ary_Ye last edited by

          @ary_ye 你跑tina的话是没有systemd注册,ntpd是service用不了ntpdate

          A 1 Reply Last reply Reply Quote Share 0
          • A
            Ary_Ye LV 5 @bayche last edited by

            @bayche 在 Yuzuki Lizard V851S开发板 –获取正确的本地时间 中说:

            @ary_ye 你跑tina的话是没有systemd注册,ntpd是service用不了ntpdate

            那大佬你用的不是Tina嘛?有啥办法解决捏?

            bayche 1 Reply Last reply Reply Quote Share 0
            • bayche
              bayche LV 6 @Ary_Ye last edited by

              @ary_ye 有一点不同
              具体参考
              https://forums.100ask.net/t/topic/3021
              是基于docker版V851S开发环境

              A 1 Reply Last reply Reply Quote Share 0
              • A
                Ary_Ye LV 5 @bayche last edited by

                @bayche 在 Yuzuki Lizard V851S开发板 –获取正确的本地时间 中说:

                @ary_ye 有一点不同
                具体参考
                https://forums.100ask.net/t/topic/3021
                是基于docker版V851S开发环境

                好的,受教了👼

                1 Reply Last reply Reply Quote Share 0
                • 1 / 1
                • First post
                  Last post

                Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

                行为准则 | 用户协议 | 隐私权政策