Run date from the command line, and ensure that the appropriate time, date, and timezone are reported. Make sure to replace America/Chicago with the directory (if your zone has one) and filename of the timezone you wish to use. Next, create the link: $ sudo ln -s /usr/share/zoneinfo/ America/Chicago /etc/localtime $ sudo mv /etc/localtime /etc/localtime.bak It’s always good practice to make backups of original config files. If you create a link, everything will take care of itself.įirst, make a backup of the existing localtime file. So, if you simply made a copy of the file, you’ll have to know when these updates come out and manually copy the file over. If your server has an automated process to update these files when daylight savings calculations change, your /usr/share/zoneinfo files will be updated but the /etc/localtime file will not be. When this change happened, all servers needed to be updated with new zoneinfo files. Many people don’t realize this, but the daylight savings days were changed in 2007. Let me explain the reasoning for this quickly.Ī crucial part of the timezone shift calculations is the daylight savings calculations. Now, I say replace, but I actually recommend creating a link to the pertinent file rather than actually making a copy. We simply need to replace this file with the file we selected in the previous step. The default will vary depending on your server host but often seems to be EST or EDT (depending on the time of year you are checking). The active timezone used on your system is in the /etc/localtime file. Make note of the appropriate folder and file for your timezone. For my location, Oklahoma, USA, I actually have two that I can select from: America/Chicago or US/Central. Select the appropriate named timezone for your location. There are a series of time zone files located at /usr/share/zoneinfo. Please note that you have to have root access to be able to make the changes detailed below. Fortunately though, it’s not hard to do with the right directions. Set Timezone on CentOS 7 Linux 1- To see the time position as well as your server time information, you can enter the following command. Unfortunately, this is not an easy thing to figure out. You check the time from the command line (run date), and find that the timezone is set to US Eastern or some other timezone. You just got your new CentOS dedicated server, and you notice that times in your logs aren’t quite right.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |