All the operating systems has a default time zone configured. Sometimes users are required to change the default timezone to some other timezone as per their requirements on Linux system. This tutorial will help to change the timezone on Ubuntu 18.04 & 16.04 LTS systems.
Check Current Timezone
Linux uses /etc/localtime file as current systems timezone. We can simply use “
date Wed Sep 5 20:40:27 IST2018
As per above output, the current time zone is set to IST.
Change Timezone on Ubuntu
The Ubuntu operating systems keep all timezone configuration files inside /usr/share/zoneinfo/ directory. Before using the new configuration, rename or unlink old configuration file as:
sudo mv /etc/localtime /etc/localtime.old
Then create a symbolic link of /etc/localtime with new timezone settings file. For below example, I am using America/New_York (EST/PST) timezone for my server. To find out more timezone list visit here.
sudo ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
Your time zone has been changed successfully. Let’s check timezone again.
date Wed Sep 5 11:11:56 EDT2018