[LINUX] Time zone

Check the current time zone

$ date
Fri Apr 17 11:51:41 UTC 2020

Specifiable time zone

Files under / usr / share / zoneinfo /. For directory structure Region A / Region B. For example, in the case of Tokyo,  ĽAsia / Tokyo`.

Change time zone

Temporarily changed by environment variable

$ export TZ="Asia/Tokyo"; date
Fri Apr 17 20:53:49 JST 2020

Permanently changed

Copy the files under / usr / share / zoneinfo to / etc / localtime, or make a symbolic link.

cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

For CentOS

Use timedatectl.

$ timedatectl set-timezone Asia/Tokyo
$ timedatectl status

reference

https://eng-entrance.com/linux-time-timezone

Recommended Posts

Time zone
Set the time zone to Japan Standard Time
measurement of time
[Python3] A story stuck with time zone conversion
Time Series Decomposition
python time measurement
First time python
I want to manage systemd by time zone! !!
Change the time zone with Docker in Oracle Database