Am trying to get my current time from cpanel
am using this code
date_default_timezone_set('Asia/Kolkata');
$timestamp = date("H");
echo $timestamp;
It works fine in localhost but in cpanel it shows different time.
So I check cpanel which default time is set here
echo 'Time zone is: '.date('e');
echo 'Time zone is: '.date_default_timezone_get();
It shows the result UTC is the time zone, Now how to set my default time zone that is ‘Asia/kolkata‘
Anyone Please give me some idea, Thanks in Advance
My cpanel files
2
Answers
Try to set your timezone in php.ini and restart server.
https://www.inmotionhosting.com/support/website/php/setting-the-timezone-for-php-in-the-phpini-file
You need to set timezone for Apache(web server) or Mysql ?
do you have access to WHM?
do you have access to SSH of your server?
Which version of Apache / PHP / Mysql you are using?
if you are on shared hosting you can not do it from cPanel, thats why required above details.
Thanks