skip to Main Content

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

enter image description here

2

Answers


  1. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search