This should be it, I'd recommend you go through all your servers and make sure that the time is properly set. Restart Apache (so the change will take effect) with the command: PHP is now properly configured for your time zone. For example, if you're in Louisville, KY, the time zone line would be:ĭate.timezone = America/Kentucky/Louisville In some instances, where you live in a city with the same name as cities in other states, you'll have to use the format GEOGRAPHIC_REGION/STATE/CITY. Where GEOGRAPHIC_REGION is your Country (or region) and CITY is the city in which you are located. Many things have changed in CentOS 7, one of many new features is the timedatectl comand. This line needs to be configured in the form: This has set our Linux System timezone to America/Denver permanently. Type the +W key combination, type timezone, and hit Enter. We'll assume that you're running php 7.2 on your server and that the path to your php.ini is the one shown below, so we'll go ahead modify the php.ini file as follows: I will see you how to change TimeZone on CentOS 7 server step by step. You most likely also have PHP installed on your server as nowadays most way too many web services depend on it, so we'll also learn how to set the time zone on your php installation. :~# sudo dpkg-reconfigure tzdataĬurrent default time zone: 'America/Chicago' Here you can locate the time zone you wish to apply to your server, in my case I'll go ahead and set the time zone to Chicago, and I can verify this afterwards by running the following command: If your time zone is not properly set, no worries, let's use the following command to change it: :~# timedatectl status | grep "Time zone" This command should report the currently set time zone: Let's first find out what the time zone currently is, we may not need to modify anything if it's properly set On this guide we're going to show you how to properly set the time zone on your Linux server, we're using an Ubuntu server for this guide, but this process should work fine on any other recent Linux distribution. As much as time is important for your daily routine (or should be), so is time important for your server, as an IT admin or sysadmin making sure that the time zone is properly set on your server can make the difference on whether the applications it hosts run properly. By default, time zone is set to UTC time (Greenwich Mean Time).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |