要检查时区的“夏令时”配置,我们可以使用以下命令:zdump -v <timezone>
但是有时国家/地区的政策会发生变化。可以通过此命令下载和应用新的更新:zic <timezone>
例如(这只是一个示例,澳大利亚没有更改):
[root@test DST]# zdump -v Australia/Canberra | grep '2023'
Australia/Canberra Sat Apr 1 15:59:59 2023 UTC = Sun Apr 2 02:59:59 2023 AEDT isdst=1 gmtoff=39600
Australia/Canberra Sat Apr 1 16:00:00 2023 UTC = Sun Apr 2 02:00:00 2023 AEST isdst=0 gmtoff=36000
Australia/Canberra Sat Sep 30 15:59:59 2023 UTC = Sun Oct 1 01:59:59 2023 AEST isdst=0 gmtoff=36000
Australia/Canberra Sat Sep 30 16:00:00 2023 UTC = Sun Oct 1 03:00:00 2023 AEDT isdst=1 gmtoff=39600
[root@test DST]# zic australasia
[root@test DST]# zdump -v Australia/Canberra | grep '2023'
Australia/Canberra Sat Apr 2 16:59:59 2023 UTC = Sun Apr 2 02:59:59 2023 AEDT isdst=1 gmtoff=39600
Australia/Canberra Sat Apr 2 17:00:00 2023 UTC = Sun Apr 2 02:00:00 2023 AEST isdst=0 gmtoff=36000
Australia/Canberra Sat Sep 29 16:59:59 2023 UTC = Sun Oct 1 01:59:59 2023 AEST isdst=0 gmtoff=36000
Australia/Canberra Sat Sep 29 17:00:00 2023 UTC = Sun Oct 1 03:00:00 2023 AEDT isdst=1 gmtoff=39600
如果出现错误并且我想恢复更改怎么办?有没有办法备份以前的配置然后应用新的更改?如果可以进行备份,那么我该如何恢复呢?
来自
man tzfile
:并
man zic
说:备份这两个目录将是一个好的开始:
如果以后需要恢复: