How To Change Server Time In Cpanel
Guide for changing TimeZone of WHM/cPanel Server
Hello,
Today we will show you the Guide for changing TimeZone of Server using cPanel / WHM. The steps are very simple to follow, we will include screenshots as well for demonstration.
Requirements
- WHM / cPanel installed on Server with its credentials.
- Root SSH Access to MySQL Server
Procedure
Change TimeZone in WHM
This will change TimeZone for all cPanel users and all websites hosted on it.
- Login to WHM using the credentials
- Look for "Server Configuration" Section or Search in search bar on left pane and tap on it
- Click on "Server Time" option as shown in screenshot below
- Select the appropriate timezone that you want on your server from drop-down list shown below
- Click on the "Change TimeZone" button.
Note- If you doubt that time shown is incorrect then use "Sync Time with Time Server" option to fix it. - If WHM asks to reboot the server then please perform a server reboot from WHM itself.
Change TimeZone for Particular Website or All Websites in PHP INI Manager
-
- Login to your cPanel Account
- Search or locate "MultiPHP INI Editor" and open it.
- Select Editor Mode Tab
- Tap on "Select a location" option
Here you will find "Home Directory" and List on domains in your cPanel account.
Making Changes in Home Directory will change for all the domains while making changes for the domain will change only for that domain and rest are unaffected and will follow Global TimeZone Settings. - We will select domain some-domain.com domain from list.
- Text Editor Opens for us on the screen. We will type below for IST TimeZone.
date.timezone = "Asia/Kolkata"
You can find list of timezones here.
- Press save button.
- Create test.php inside your domain directory and add following code and save file.
<?php
// Show all information, defaults to INFO_ALL
phpinfo();?>
- Now open browser and open some-domain.com/test.php and you can see as following if steps followed correctly.
Change TimeZone for MySQL Server
- Login to root via SSH where MySQL Server is hosted.
- Run this command in terminal and enter password when prompts
mysql -p -e "SELECT @@global.time_zone;"
SYSTEM here means MySQL is using default TimeZone as Servers TimeZone. - Check data for server using date command
date
- Check MySQL Server Time using following command
mysql -p -e "SELECT NOW();"
- Now edit configuration file for MySQL /etc/my.cnf and add it under [mysqld] section not [mysqld_safe]
default-time-zone = 'Asia/Calcutta'
- Restart MySQL Server
sudo service mysqld restart
- Now check timezone for MySQL Server
mysql -p -e "SELECT @@global.time_zone;"
- Now check MySQL Server Time using following command
mysql -p -e "SELECT NOW();"
Hope this brief guide will help you changing TimeZone for WHM/cPanel, For Specific Website for User and for MySQL Server.
How To Change Server Time In Cpanel
Source: https://www.basezap.com/changing-timezone-whm-cpanel-server/
Posted by: youngerthearn1956.blogspot.com
0 Response to "How To Change Server Time In Cpanel"
Post a Comment