[LINUX] How to set the server time to Japanese time

When the server time was the standard time in the world

If nothing is set, this should happen, but since I am Japanese and live in Tokyo, Tokyo time is good.

$ date
Fri Jun 12 04:32:25 UTC 2020

For CentOS7

--Environment: CentOS Linux release 7.8.2003 (Core)

#localtime is linked to UTC
$ ls -la /etc/localtime
lrwxrwxrwx. 1 root root 25 Feb 29 12:11 /etc/localtime -> ../usr/share/zoneinfo/UTC

#When I searched for Japan for a moment, I found "Asia" and "Japan".
$ ls -la /usr/share/zoneinfo/ | grep -e Asia -e Japan
drwxr-xr-x.  2 root root   4096 Feb 29 12:06 Asia
-rw-r--r--.  2 root root    292 Sep 26  2019 Japan

# `Asia/Tokyo`But`Japan`It seems that it is not linked to
$ ls -la /usr/share/zoneinfo/Asia/ | grep Tokyo
-rw-r--r--.  2 root root  292 Sep 26  2019 Tokyo

How to make Japan time only now

Reference: [Linux] Timezone change --Qiita

#Overwrite symbolic links in Tokyo
$ ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
$  ls -la /etc/localtime
lrwxrwxrwx. 1 root root 30 Jun 15 10:45 /etc/localtime -> /usr/share/zoneinfo/Asia/Tokyo

$ date
Mon Jun 15 10:45:55 JST 2020

How to make it all the time in Japan

Reference: [[timedatectl] command-Display / set time: Linux basic command Tips (312)[email protected]](https://www.atmarkit.co.jp/ait/articles/1906/13/news007. html)

$ timedatectl
      Local time: Tue 2020-06-30 06:20:07 UTC
  Universal time: Tue 2020-06-30 06:20:07 UTC
        RTC time: Tue 2020-06-30 06:20:07
       Time zone: UTC (UTC, +0000)

#If you look for something that looks like Japan, "Asia"/There was "Tokyo"
$ timedatectl list-timezones | grep -i -e japan -e tokyo

#Set the time zone to "Asia"/Set to "Tokyo"
$ sudo timedatectl set-timezone Asia/Tokyo

$ timedatectl
      Local time: Tue 2020-06-30 15:21:18 JST
  Universal time: Tue 2020-06-30 06:21:18 UTC
        RTC time: Tue 2020-06-30 06:21:18
       Time zone: Asia/Tokyo (JST, +0900)

$ date
Tue Jun 30 15:21:31 JST 2020

Recommended Posts

How to set the server time to Japanese time
How to get and set the NTP server name by DHCP
How to use MkDocs for the first time
How to set up a local development server
How to use the generator
[Blender] How to dynamically set the selection of EnumProperty
[Introduction to Udemy Python3 + Application] 30. How to use the set
How to use the decorator
How to increase the axis
How to start the program
How to set the html class attribute in Django's forms.py
How to set the extended iso8601 format date to the Dataframe index
How to calculate the autocorrelation coefficient
How to use the zip function
How to use the optparse module
How to read the SNLI dataset
How to get the Python version
[Python] How to import the library
How to overwrite the output to the console
How to use the ConfigParser module
How to handle Japanese in Python
How to set cron for regular Python scraping on Sakura server.
How to set the output resolution for each keyframe in Blender
A note on how to check the connection to the license server port
How to set up the development environment of ev3dev [Windows version]
How to display the progress bar (tqdm)
How to build my own Linux server
How to use the Spark ML pipeline
How to compare time series data-Derivative DTW, DTW-
How to check the version of Django
How to solve the bin packing problem
How to set up SVM using Optuna
How to manually update the AMP cache
[Linux] How to use the echo command
How to use the Linux grep command
How to set xg boost using Optuna
How to use Japanese with NLTK plot
How to display python Japanese with lolipop
How to get colored output to the console
How to operate Linux from the console
How to enter Japanese with Python curses
How to access the Datastore from the outside
How to use the IPython debugger (ipdb)
How to handle time series data (implementation)
[Python] What is a formal argument? How to set the initial value
How to get the date and time difference in seconds with python
[Python] How to set the (client) window size inside the browser with Selenium
[Development environment] How to create a data set close to the production DB
Set up a server that processes multiple connections at the same time
[Python] How to open two or more files at the same time
How to assign multiple values to the Matplotlib colorbar
How to calculate the volatility of a brand
How to specify the launch browser for JupyterLab 3.0.0
How to find the area of the Voronoi diagram
How to specify the NIC to scan with amazon-dash
How to avoid writing% matplotlib inline every time
How to achieve time wait processing with wxpython
[Python] How to change the date format (display format)
How to set up Random forest using Optuna
Set the range of active strips to the preview range
How to set browser location in Headless Chrome