Repeat the ‘date’ command above to make sure it’s all correct and you’re done. By default, the Linux shell uses the host servers time zone. įor my use I need the Europe/London zone so I can set it using: ~] sudo timedatectl set-timezone Europe/London So we can use the ‘grep’ command to find what we need: ~] timedatectl list-timezones | grep EuropeĮurope /Kirov Europe /Lisbon Europe /Ljubljana Europe /London Europe /Luxembourg Europe /Madrid Europe /Malta Europe /Mariehamn.
You can scroll through these, but it’s a big list. For example, the file /usr/share/zoneinfo/America/NewYork represents time zone for New York. Advertisement CentOS timezone config files and directories /usr/share/zoneinfo/ The system timezone directory contains the files as per timezone name.
To view a list of the available timezones, use the following: ~] timedatectl list-timezonesĪfrica/Abidjan Africa/Accra Africa/Addis_Ababa Africa/Algiers Africa/Asmara Africa/Bamako Africa/Bangui Africa/Banjul Africa/Bissau Africa/Blantyre. You can easily change timezone in CentOS Linux using the following methods. To keep ensure your logs are easy to analyse and some scripts operate correctly, it’s a good idea to set your server timezone to match where you are.ĭisplay the current zone (and time) by using the ‘date’ command: ~] dateįrom the above, you can see my timezone is set to BST. The timezone files are located at /usr/share/zoneinfo and you simply need to create a symbolic link from /etc/localtime to point to.