Step 1. Navigate to your php.ini file it should be /etc/php5/apache2/php.ini.
Step 2. Open the file in text editor.
Step 3. Search for the date.timezone and there should be ;date.timezone =. See the reference snapshot below:
Step 4. Remove the ; and put your time zone here just like as US/Arizona OR Asia/Kolkata or you can find the date time zone on http://php.net
Step 5. Now the syntax will look like as date.timezone = “Asia/Kolkata”.
Step 6. Save and Close the file.
Step 7. Now restart the apache server by using the command /etc/init.d/apache2 restart
OR you can do it by using the command prompt:
1. Navigate to the folder location where is the php.ini file is and use the below command to open the file
nano php.ini
file will look like as the below screenshot
2. Now search for the date.timezone and edit it just like as the below:
date.timezone = “Asia/Kolkata”
as per the screenshot below
3. Now Press CTRL+X then Y and Enter;
4. Now restart the apache server by using the command /etc/init.d/apache2 restart
You have done now the problem has been gone. Thanks for reading and enjoy the coding.