Change timezone in Linux from Command Line

From here, originally
Location of the local time file
Linux looks at /etc/localtime to determine the current time of your machine. This can either be a symbolic link to the correct time zone or a direct copy of the time zone file.
Timezone files are located in /usr/share/zoninfo/
For this tip we will assume your server is located in America and will be under the Chicago CST zone.
I change the Linux time zone by copying or making a symbolic link to from /usr/share/zoneinfo/America/Chicago to /etc/localtime
Two methods to do this
1) cp /usr/share/zoneinfo/America/Chicago /etc/localtime
2) ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
Type w to change the new time and you’re done!h

Comments

Popular Posts