Why my application keep showing UTC time?
This has cause your application not to log the correct time when the function being executed.
This issue are cause by the PHP default timezone. By default, all our servers which is running PHP will used default PHP time zone, which is UTC. You can verify this by running a phpinfo() function inside your php file. You will see the output of the default timezone used by PHP under date directives.
Solutions:
To set your preffered timezone, you will need to do below steps:
- Login to your cpanel account.
- Access File Manager and open public_html folder.
- Create a php.ini file and fill it with below variable:
date.timezone = "Asia/Kuala_Lumpur"
** you may change “Asia/Kuala_Lumpur” with your preffered timezon base on this link: PHP TimeZone
- Now edit your .htaccess file and add below lines:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/username/public_html/php.ini
</IfModule>
- Save and check your date setting now.