linux系统启用夏令时,在Debian Linux中禁用夏令时

我不希望我的系统使用夏令时.

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值