Quick repair of Centos7 System Time Zone !, Centos7 Time Zone

Source: Internet
Author: User

Quick repair of Centos7 System Time Zone !, Centos7 Time Zone

Note: After modifying the time zone of the Linux system, install jvm again. By default, the jvm uses the time zone of the system.
If the system time zone is set incorrectly, modify the system time zone after jvm is installed, but the jvm time zone remains unchanged, unless the jvm startup parameter-D user. timezone = GMT + 08 is added

Method 1: timedatectl set-timezone Asia/Shanghai
# timedatectlWarning: Ignoring the TZ variable. Reading the system's time zone setting only.Local time: Mon 2016-11-21 01:52:42 ESTUniversal time: Mon 2016-11-21 06:52:42 UTCRTC time: Mon 2016-11-21 06:52:42Time zone: America/New_York (EST, -0500)NTP enabled: n/aNTP synchronized: noRTC in local TZ: noDST active: noLast DST change: DST ended atSun 2016-11-06 01:59:59 EDTSun 2016-11-06 01:00:00 ESTNext DST change: DST begins (the clock jumps one hour forward) atSun 2017-03-12 01:59:59 ESTSun 2017-03-12 03:00:00 EDT

Set the time zone to CST (East 8)

# timedatectl  set-timezone Asia/ShanghaiWarning: Ignoring the TZ variable. Reading the system's time zone setting only.Local time: Mon 2016-11-21 14:52:59 CSTUniversal time: Mon 2016-11-21 06:52:59 UTCRTC time: Mon 2016-11-21 06:52:59Time zone: Asia/Shanghai (CST, +0800)NTP enabled: n/aNTP synchronized: noRTC in local TZ: noDST active: n/a[root@localhost ~]#
Method 2: TZ Environment Variables

Modify. bash_profile in the user directory and append it to the end of the file:

TZ='Asia/Shanghai'; export TZ

After the launch of login, log on again. The date command can view the effect.

Contact Us

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.