LoginSignup
0
0

More than 3 years have passed since last update.

ubuntuのローカルタイムを変更する

Posted at

環境

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04.6 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.6 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

現在の時間確認

$ date
Sat May 11 12:29:50 UTC 2019

または

$ timedatectl
      Local time: Sat 2019-05-11 12:30:32 UTC
  Universal time: Sat 2019-05-11 12:30:32 UTC
        Timezone: Etc/UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

時間を日本時間に変更する

$ timedatectl set-timezone Asia/Tokyo

再確認

$ date                                    
Sat May 11 21:32:39 JST 2019

$ timedatectl                                                                                                                                                   
      Local time: Sat 2019-05-11 21:32:45 JST
  Universal time: Sat 2019-05-11 12:32:45 UTC
        Timezone: Asia/Tokyo (JST, +0900)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

その他

変更できるtimezone一覧

$ timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
...

時間指定する場合

$ timedatectl set-time "2019-05-01 00:00:00"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0