Check and Change current TimeZone in CentOS 6 and CentOS 7
Wondering about TimeZone of your CentOS Machine and want to change it? Let’s follow this small guide to check and change current TimeZone in CentOS 6 and Centos 7.
Requirements
- Root SSH Access to CentOS Machine (Root Needed to change TimeZone)
Procedure
Check Current Date, Time and TimeZone in CentOS 6/7
- Check Date of your Machine which includes Time.
date
- Check Current TimeZone.
date +'%Z %z'
Our Current TimeZone is CDT
Change TimeZone in CentOS 6
- Backup current TimeZone in /root directory
cp /etc/localtime /root/timezone.old
- Create Symbolic Link to your desired TimeZone
Our desired TimeZone is IST
ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
- Check Date
date
- Verify TimeZone
date +'%Z %z'
Change TimeZone in CentOS 7
- List all TimeZone
timedatectl list-timezones
- List TimeZones of Asia
timedatectl list-timezones | grep Asia
- Change TimeZone to IST
timedatectl set-timezone Asia/Kolkata
- Check Date
date
- Check TimeZone
date +'%Z %z'