Set Timezone

Set Timezone

It is important to have correct time on the server for logging or for One-Time Password module.

Show current timezone

You can use sudo timedatectl command to do that.

tacgui@tacacsgui:~$ sudo timedatectl
      Local time: Tue 2018-05-22 12:12:50 MSK
  Universal time: Tue 2018-05-22 09:12:50 UTC
        RTC time: Tue 2018-05-22 09:12:50
       Time zone: Europe/Moscow (MSK, +0300)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

By default it is Europe/Moscow timezone.


Change Timezone

Use command sudo timedatectl set-timezone Etc/GMT-/+X to change timezone, where -/+X is “timezone appender”. For example to get the same time as for Europe/Moscow you should get Etc/GMT-3

gurkin33@tacgui-developer:~$ sudo timedatectl set-timezone Etc/GMT-3 # apply new timezone
gurkin33@tacgui-developer:~$ sudo timedatectl # check the timezone settings
      Local time: Tue 2018-05-22 12:06:59 +03
  Universal time: Tue 2018-05-22 09:06:59 UTC
        RTC time: Tue 2018-05-22 09:06:59
       Time zone: Etc/GMT-3 (+03, +0300)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

As I think you can take that example and apply your timezone.

Created at: 2018-05-14 14:59:15
Updated at: 2018-05-22 12:23:56
Author: Alexey Mochalin