I've set my server's timezone to Central:
/etc/localtime -> /usr/share/zoneinfo/US/Central
After rebooting, when I run the date command, the time is still listed in UTC.
[root@dev etc]# date
Sat Oct 5 16:14:28 UTC 2013
How can I get it to display in the local timezone?
Timekeeping tips for your CentOS system.
ln -fs /usr/share/zoneinfo/America/Chicago /etc/localtime
/etc/sysconfig/clock
- Mine only containsZONE="America/Chicago"
ntp
. There's no excuse not to have it running.hwclock -w
These changes take effect immediately, such that your date command should output:
Also make sure that the environment variable
TZ
is unset, as it overrides what is configured by/etc/localtime
.Even an innocent
export TZ=
makes date (and other utilities) default to outputting UTC.Check
/etc/environment
,/etc/profile
,/etc/bash.bashrc
,~/.profile
,~/.bashrc
, your Desktop Environment configuration and other commonly sourced configuration files for instances of setting and exporting TZ and remove them.Edit:
Also check that your
/usr/share/zoneinfo/US/Central
is a valid existing file:You could check if there is something wrong with this file: /etc/localtime
Using for example:
In my case the information for this year looks like this:
I had the exact same issue and updating tzdata fixed it for me: