centos系统时区设置,美国西五区

查看时区
tzselect 

GMT-5

Washington

America/Washington

# 设置时区 New_York有夏时令替换,Atikokan和EST无夏时令替换
timedatectl set-timezone America/New_York

timedatectl set-timezone America/Atikokan


ln -sf /usr/share/zoneinfo/EST /etc/localtime

#查询时区 
timedatectl | grep "Time zone"


timedatectl set-timezone Asia/Singapore


timedatectl set-timezone Asia/Shanghai

Asia/Shanghai

//mysql .ini
default-time-zone = '-5:00'


/----------------强制修改本地时间---------------------
timedatectl

开启关闭ntp(这样就不会自动同步时间了)
timedatectl set-ntp true/false

timedatectl set-ntp false

date -s '2021-09-01 20:57:00'

date -s '2021-10-18 22:01:30'

mv /etc/localtime /etc/localtime5.bak

ls /usr/share/zoneinfo/

ln -s /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime

ln -s /usr/share/zoneinfo/UTC-05  /etc/localtime


ln -s /usr/share/zoneinfo/EST5EDT  /etc/localtime


ln -s /usr/share/zoneinfo/EST-05  /etc/localtime

  EST
  
GMT
UTC
GST+4

CST-13

//--------------------直接这里设置----------------------------------
vi etc/profile

export TZ='GST+5'

export TZ='GST+4'


方法2:
让/etc/profile文件修改后立即生效 ,可以使用如下命令:
# source /etc/profile


%2d
serverTimezone=GMT%2D5
serverTimezone=GMT%2B8


-Duser.timezone=GMT-05


set global time_zone='-5:00';


&useTimezone=true&serverTimezone=GMT%2D5

上面是我到处找的,但是最终西五区时间,我用的是下面

/----------------强制修改本地时间---------------------
timedatectl

开启关闭ntp(这样就不会自动同步时间了)
timedatectl set-ntp true/false

timedatectl set-ntp false

date -s '2021-09-01 20:57:00'

date -s '2021-10-18 22:01:30'


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值