Centos7改系统时区方法有哪些

centos7修改系统时区的两种方法:1、使用timedatectl命令,可设定和修改时区信息,语法“timedatectl  set-timezone 时区标识”;2、修改用户目录下的“.bash_profile”文件,在文件末尾追加“tz='时区标识'; export tz”即可。

(图1)

本教程操作环境:centos7系统、thinkpad t480电脑。

修改Centos7系统时区的两种方法

注意:修改Linux系统的时区以后,再安装jvm,jvm默认会使用系统的时区。

如果系统时区设置错误,安装jvm后,再修改系统的时区,但jvm的时区仍然用不变,除非添加jvm的启动参数:-D user.timezone=GMT+08

方法1: timedatectl  set-timezone Asia/Shanghai

timedatectl是Linux下的一条命令,用于控制系统时间和日期。可以用来查询和更改系统时钟于设定,同时可以设定和修改时区信息。

# timedatectl
Warning: Ignoring the TZ variable. Reading the system's time zone setting only.

Local time: Mon 2016-11-21 01:52:42 EST
Universal time: Mon 2016-11-21 06:52:42 UTC
RTC time: Mon 2016-11-21 06:52:42
Time zone: America/New_York (EST, -0500)
NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Sun 2016-11-06 01:59:59 EDT
Sun 2016-11-06 01:00:00 EST
Next DST change: DST begins (the clock jumps one hour forward) at
Sun 2017-03-12 01:59:59 EST
Sun 2017-03-12 03:00:00 EDT
1、本站目前拥有近 1000+ 精品收费资源,现在加入VIP会员即可全部下载。
2、本资源部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
SEA模板网 » Centos7改系统时区方法有哪些

发表评论

加入本站VIP会员订阅计划,海量资源免费查看

目前为止共有 3654 位优秀的VIP会员加入! 立刻加入VIP会员