CENTOS7 Modify the system time zone timezone & Modify the time zone after the JVM time zone is not updated
Create an Alibaba Cloud account, and get a free trial with 40+ products, enterprise account can enjoy a free trial worth $1200. Register Now!
CENTOS7 Modify the system time zone timezone
Note: After modifying the time zone of the Linux system, installing JVM,JVM will use the system's time zone by default. If the system time zone is set incorrectly, after installing the JVM, modify the system's time zone, but the JVM's time zone remains unchanged unless you add the startup parameters for the JVM:-D user.timezone=gmt+08
Method 1:timedatectl Set-timezone Asia/shanghai # 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 &N Bsp RTC Time:mon 2016-11-21 06:52:42 time zone:america/new_york (EST, -0500) &NBSP;NTP enabled:n/a NTP synchronized:no rtc in local tz:no DST Active:no la St DST Change:dst ended at Sun 2016-11-06 01:59:59 EDT &nb Sp 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 E ST Sun 2017-03-12 03:00:00 EDT set time zone to CST (East 8 area) # timedatectl set-timezone asia/shanghai warning:ignoring th e TZ variable.Reading the system ' s time zone setting only.
Local Time:mon 2016-11-21 14:52:59 CST Universal Time:mon 2016-11-21 06:52:59 UTC RTC Time:mon 2016-11-21 06: 52:59 Time Zone:asia/shanghai (CST, +0800) NTP enabled:n/a NTP synchronized:no RTC into local tz:no D ST active:n/a [Root@localhost ~]#
Method 2:tz the environment variable to modify the. Bash_profile in the user directory, append at the end of the file: tz= ' Asia/shanghai '; Export TZ Login After the launch, the date command can view the effect.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.