This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Am335X 时区设置

Other Parts Discussed in Thread: SYSCONFIG

各位好:

    现在使用AM335x开发单板,软硬件系统基本测试完毕,现在碰到时区设置问题,搜索文件系统中,没有时区设置的配置文件。开发环境如下:

   sdk:ti-processor-sdk-linux-am335x-evm-01.00.00.03/

    文件系统:使用上面的sdk自带的tisdk-rootfs-image-am335x-evm.tar

    RTC:ds1307

RTC可以保存当前时间,不过是UTC时间,将时区设置成Asia/Shanghai,写入RTC,读出来的还是UTC时间。

系统启动打印:rtc-ds1307 0-0068: setting system clock to 2016-09-19 09:22:08 UTC (1474276928)

设置时区的命令:TZ='Asia/Shanghai'; export TZ

date和hwclock命令读写结果:

root@TG1000:~# date -R
Mon, 19 Sep 2016 10:02:37 +0000
root@TG1000:~# hwclock -r
Mon Sep 19 10:02:47 2016  0.000000 seconds
root@TG1000:~#