Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Set or Change Timezone on Ubuntu 22.04 - DesignLinux

Nov 11 2022
designlinux 0 Comments
how-to-install-change-timezone-on-ubuntu-22-04

In this tutorial explained how to set or change the timezone on Ubuntu 22.04 system. It is very important to have correct system timezone because it’s not just displaying time but it do a lot more. Incorrect timezone can have an impact on server logs, reporting, email, and file timestamps.

Timezone is very important to run all the reminders and cron jobs properly at expected time. Therefore, it’s a very essential step to set a right time zone on your Ubuntu system. You can change timezone via both GUI and command line.

Checking Current Timezone#

You can easily get and set system’s timzone easily using timedatectl command-line utility. Execute the following command in order to view the current time zone information:

timedatectl

It should display output as below:

               Local time: Wed 2022-11-09 12:00:20 UTC
           Universal time: Wed 2022-11-09 12:00:20 UTC
                 RTC time: Wed 2022-11-09 12:00:20
                Time zone: UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

The /etc/localtime is a link to the original timezone file. To check the symbolic link use the following command:

ls -l /etc/localtime
lrwxrwxrwx 1 root root 08 November 21 05:22 /etc/localtime -> /usr/share/zoneinfo/UTC

Timezone Config Files of Ubuntu#

/usr/share/zoneinfo/ – This directory contains the timezone files name wise. For example, the file /usr/share/zoneinfo/America/New_York represents time zone for New York.

/etc/localtime – This is a symlink to the file localtime located in /usr/share/zoneinfo/ directory.

Change Timezone on Ubuntu 22.04#

At first, you should know long name for timezone for which you want to set. Run below command to get the list of all available timezones:

timedatectl list-timezones

It will show output like below:

Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
...
...
America/Caracas
America/Cayenne
America/Cayman
America/Chicago
America/Chihuahua
America/Costa_Rica
...
...
Pacific/Saipan
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Wake
Pacific/Wallis
UTC

Take the long name of timezone for your location, run the following command as root or user with sudo privileges.

The syntax for command is:

sudo timedatectl set-timezone NEW_TIME_ZONE

For example, to change timezone to America/New_York run command as below:

sudo timedatectl set-timezone America/New_York

Now, verify timezone again using timedatectl command:

timedatectl

It should changed with new timezone America/New_York.

               Local time: Wed 2022-11-09 08:02:49 UTC
           Universal time: Wed 2022-11-09 01:03:41  UTC
                 RTC time: Wed 2022-11-09 01:03:41 
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Change Timezone By Symlink#

You can change the timezone using alternate way by creating a symlink. This method is useful when your server is running older version of Ubuntu or not have timedatectl command is available. We are going to change the timezone by creating symlink /etc/localtime to the timezone in the /usr/share/zoneinfo directory.

Determine timezone, which you want to set and create a symlink, type:

sudo ln -s /usr/share/zoneinfo/America/New_York /etc/localtime

To verify changes, list the /etc/localtime file or run the date command:

date
Wed November 09 08:15:25 EDT 2022

It should show new changed date and time with new timezone.

Conclusion#

You have successfully learned how to get and set the timezone on the Ubuntu 22.04 Jammy Jellyfish system.

Feel free to leave comment if you have any questions.

Related

Tags: terminal, timezone, ubuntu

How to Install Apache on Debian 11

Prev Post

How to Install Chromium Web Browser on Ubuntu 22.04

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 623
  • 609,982

DesignLinux.com © All rights reserved

Go to mobile version