This post very useful information about changing the timezone in Ubuntu, CentOS, Fedora, RHEL system. We have already discussed about manage timezones.
This page shows two different types to chnages the timezone in Linux sytems.
Type 1:
For example establish time format in Ubuntu 15.04, now check your current time,
# date
Thu Nov 12 00:53:20 EST 2015
Open your terminal and run the below command,
# dpkg-reconfigure tzdata
In configuration tzdata, select time zones in which they are located (use UP and DOWN arrow key) then hit the Enter Key.
Then select the city or region corresponding to your time zone. next hit the Enter Key.
Output :
Current default time zone: 'Asia/Kolkata'
Local time is now: Thu Nov 12 11:24:14 IST 2015.
Universal Time is now: Thu Nov 12 05:54:14 UTC 2015.
Finally check the currently system date and time.
# date
Thu Nov 12 11:24:17 IST 2015
Also you can use same format in Redhat, CentOS/Fedora,FreeBSD/Slackware using the below command,
Redhat:
# redhat-config-date
CentOS/Fedora:
# system-config-date
FreeBSD/Slackware:
# tzselect
Note : If you could not found the command system-config-date, Its asking permission to you for install that package in your system. then press 'y'.
bash: system-config-date: command not found...
Install package 'system-config-date' to provide command 'system-config-date'? [N/y] y
Type 2 :
The following commands can be support to change timezone fromat in CentOS 7, Fedora 23, Ubuntu 15.04
Syntax :
sudo timedatectl set-timezone <timeszone>
set timezone as EST:
# sudo timedatectl set-timezone EST
set timezone as UTC:
# sudo timedatectl set-timezone UTC
Do you want to set specific timezone format run the command,
# sudo timedatectl set-timezone Asia/Kolkata
List all timezone formats.
# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Comments (0)