Linux - How to set my timezone

By xngo on July 5, 2019

In this tutorial, I will show you how to set your timezone using timedatectl command.

View available timezone

Before setting the timezone, let's find out whether your timezone is part of the list of available timezones. Run the following command to view all the available timezones.

timedatectl list-timezones --no-pager

For my case, I wasn't able to find America/Montreal but the best timezone for me that I found from the list is America/Toronto.

Set timezone

To set my local timezone in Linux, I use set-timezone switch as shown below.

timedatectl set-timezone "America/Toronto"

Now, let's run the timedatectl command again to see whether the timezone has been changed.

timedatectl
# Output:
# -----------
#      Local time: Fri 2019-07-05 18:06:10 EDT
#  Universal time: Fri 2019-07-05 22:06:10 UTC
#        RTC time: Fri 2019-07-05 22:06:10
#       Time zone: America/Toronto (EDT, -0400)
# Network time on: yes
#NTP synchronized: yes
# RTC in local TZ: no

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.