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
總結
以上是生活随笔為你收集整理的linux系统启用夏令时,在Debian Linux中禁用夏令时的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: GC1262R/S 单线圈无刷直流电机驱
- 下一篇: 项目经理也分三六九等,初级项目经理和高级