双系统时间不同步问题解决方案)
前言在使用 Linux 与 Winodws 双系统时往往会遇到切换系统时间不同步这是因为 Windows 默认把主板RTC时间视作本地时间而 Linux 通常将主板RTC时间作为标准时间然后加上时区偏移在Ubuntu下设置timedatectl set-local-rtc 1就可以解决问题但在 Void Linux 下没有timedatectl命令是通过直接配置/etc/rc.conf文件实现网络上关于 Void Linux 相关配置教程的文章较少所以在这里记录一下设置过程参照 Void Linux文档 可知Void Linux时间标准通过HARDWARECLOCK环境变量控制全局设置的话直接修改/etc/rc.conf就行在/etc/rc.conf可以找到这一行关于时间的设置# Set RTC to UTC or localtime.#HARDWARECLOCKUTC去掉注释改成localtime就可以了# Set RTC to UTC or localtime.HARDWARECLOCKlocaltime这样再次重启使用双系统时间就正常了附录如果此时重启后仍发现系统存在时差则需要手动设置一下时区在/etc/rc.conf修该如下# Set timezone, availables timezones can be found at /usr/share/zoneinfo.## NOTE: its preferred to set the timezone in /etc/localtime instead:# - ln -sf /usr/share/zoneinfo/timezone /etc/localtime# Setting the timezone here requires a reboot to apply any changes/fixes# and read-write access to the filesystem.#TIMEZONEAsia/Shanghai(当然还有另一种方案将Windows时间设为UTC读取网上相关教程已经十分成熟这里就不再赘述了)