Description of problem: anolis23 previrw 在执行时间同步测试失败,硬件时间与系统时间相差8小时 Version-Release number of selected component (if applicable): # uname -r 5.19.0-2_rc1.an23.x86_64 # cat /etc/image-id image_name="Anolis OS 23. 64 bit" image_id="anolis_23__x64_20G_alibase_20221019.vhd" release_date="20221019203103" How reproducible: 必现 Steps to Reproduce: 1.安装anolis23 vhd镜像 2.运行vhd镜像测试,时间同步用例执行失败 3.查看硬件时间,系统时间,相差8小时 # hwclock 2022-10-27 23:33:21.511497+08:00 # date Thu Oct 27 15:33:23 CST 2022 Actual results: 硬件时间与系统时间相差8小时 Expected results: 硬件时间,系统时间同步 Additional info:
*** Bug 2610 has been marked as a duplicate of this bug. ***
date命令操作Linux的系统(软件)时钟,hwclock命令操作硬件时钟(rtc模块)。 当前系统里展示的时区为 上海,所以 8个小时为正常时差。 [root@iZbp1jenlv6zmemz4juo9xZ etc]# date Thu Oct 27 17:07:07 CST 2022 [root@iZbp1jenlv6zmemz4juo9xZ etc]# [root@iZbp1jenlv6zmemz4juo9xZ etc]# [root@iZbp1jenlv6zmemz4juo9xZ etc]# [root@iZbp1jenlv6zmemz4juo9xZ etc]# timedatectl Local time: Thu 2022-10-27 17:07:13 CST Universal time: Thu 2022-10-27 09:07:13 UTC RTC time: Thu 2022-10-27 17:07:12 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: yes NTP service: active RTC in local TZ: no [root@iZbp1jenlv6zmemz4juo9xZ etc]# hwclock 2022-10-28 01:08:03.104259+08:00
(In reply to happy_orange from comment #2) > date命令操作Linux的系统(软件)时钟,hwclock命令操作硬件时钟(rtc模块)。 > 当前系统里展示的时区为 上海,所以 8个小时为正常时差。 > [root@iZbp1jenlv6zmemz4juo9xZ etc]# date > Thu Oct 27 17:07:07 CST 2022 > [root@iZbp1jenlv6zmemz4juo9xZ etc]# > [root@iZbp1jenlv6zmemz4juo9xZ etc]# > [root@iZbp1jenlv6zmemz4juo9xZ etc]# > [root@iZbp1jenlv6zmemz4juo9xZ etc]# timedatectl > Local time: Thu 2022-10-27 17:07:13 CST > Universal time: Thu 2022-10-27 09:07:13 UTC > RTC time: Thu 2022-10-27 17:07:12 > Time zone: Asia/Shanghai (CST, +0800) > System clock synchronized: yes > NTP service: active > RTC in local TZ: no > [root@iZbp1jenlv6zmemz4juo9xZ etc]# hwclock > 2022-10-28 01:08:03.104259+08:00 如果是自定义版本 那这个是正常的 但从arm的版本看 这个时间是一致的 [root@iZbp1hja6glxg5e8ntui69Z ~]# date Thu Oct 27 18:02:52 CST 2022 [root@iZbp1hja6glxg5e8ntui69Z ~]# hwclock 2022-10-27 18:02:54.185536+08:00 [root@iZbp1hja6glxg5e8ntui69Z ~]# ls /etc/localtime -l lrwxrwxrwx. 1 root root 35 Oct 19 20:32 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai