View Timezone
$ timedatectl
Local time: Wed 2019-01-23 22:45:47 UTC
Universal time: Wed 2019-01-23 22:45:47 UTC
RTC time: Wed 2019-01-23 22:45:48
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no
The system timezone is configured by symlinking /etc/localtime
to a binary timezone identifier in the /usr/share/zoneinfo
directory.
ls -l /etc/localtimeCopy
lrwxrwxrwx 1 root root 27 Dec 10 12:59 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC
Alternatively, you can also check the current system’s timezone by displaying the contents of the /etc/timezone
file.
$ cat /etc/timezoneCopy
Etc/UTC
Changing the Timezone Using the timedatectl
To list all available time zones, you can either list the files in the /usr/share/zoneinfo
directory or use the timedatectl
command.
$ timedatectl list-timezonesCopy
...
Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Riga
Europe/Rome
Europe/Samara
...
Once you identify which time zone is accurate to your location, run the following command as sudo user:
$ sudo timedatectl set-timezone your_time_zone
Reference
FEATURED TAGS
algorithm
algorithmproblem
architecturalpattern
architecture
aws
c#
cachesystem
codis
compile
concurrentcontrol
database
dataformat
datastructure
debug
design
designpattern
distributedsystem
django
docker
domain
engineering
freebsd
git
golang
grafana
hackintosh
hadoop
hardware
hexo
http
hugo
ios
iot
java
javaee
javascript
kafka
kubernetes
linux
linuxcommand
linuxio
lock
macos
markdown
microservices
mysql
nas
network
networkprogramming
nginx
node.js
npm
oop
openwrt
operatingsystem
padavan
performance
programming
prometheus
protobuf
python
redis
router
security
shell
software testing
spring
sql
systemdesign
truenas
ubuntu
vmware
vpn
windows
wmware
wordpress
xml
zookeeper