我不希望我的系统使用夏令时.
root@ali-debserver:~# cat /etc/timezone
Asia/Tehran
root@ali-debserver:~# cat /etc/default/rcS
#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.
# delete files in /tmp during boot older than x days.
# '0' means always, -1 or 'infinite' disables the feature
#TMPTIME=0
# spawn sulogin during boot, continue normal boot if not used in 30 seconds
#SULOGIN=no
# do not allow users to log in until the boot has completed
#DELAYLOGIN=no
# be more verbose during the boot process
#VERBOSE=no
# automatically repair filesystems with inconsistencies during boot
#FSCKFIX=no
我无法使用ntp或tzdate永久解决此问题.如何禁用夏令时?
解决方法:
提供无DST时区定义,只定义GMT偏移量,称为Etc / GMT±X:
$date
Mon Apr 7 11:08:56 CEST 2014
$TZ=Etc/GMT-1 date
Mon Apr 7 10:09:16 GMT-1 2014
$
只需将你需要的那个链接/复制到/ etc / localtime,你应该没问题且没有DST:
$ln -s /usr/share/zoneinfo/Etc/GMT-1 /etc/localtime
编辑:对于非整数偏移,您可以自己进行.您可以构建自己的区域文件来定义所需的偏移量:将以下行放入文件中:
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Tehran-nodst 3:25:44 - LMT 1916
3:25:44 - TMT 1946 # Tehran Mean Time
3:30 - IRST 1977 Nov
4:00 - IRST 1979
3:30 - IRST
并运行
$zic -d .
这将在当前目录中生成一个名为Tehran-nodst的文件,您可以将其复制到/usr/share / zoneinfo / Asia并链接/复制到/ etc / localtime(仅执行最后一次复制也非常好).
标签:linux,timezone,time
来源: https://codeday.me/bug/20190809/1633438.html