Every operating system 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 Debian 9/8 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
See output on the screen, This will show the time zone like IST in the above result.
Change Timezone on Debian
Debian 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