Setting the Timezone for PHP in the php.ini File
If you notice the correct time is not displaying in your PHP scripts the likely culprit is that the hosting server is in a different timezone. You can easily resolve this by adding a line of code to your php.ini file. The location you set in the code will determine the time to display in your PHP scripts.
- Open your php.ini file with the File Manager in cPanel
If you need further assistance please feel free to ask a question on our support center.
News / Announcements
Support Center Login
Social Media Login
I have changed the timezone ini.php file and its changed there successfully even i tested with phpinfo.php it showing there same as per my chnages. but the time on my website still same as before (wrong time). So, please advice what to do?
Great tutorial. This tutorial was really useful to set timezone.
Nice tutorial.This tutorial was really helpful to me on set timezone.
I set timezone as asia/kolkata in my server but it showing 4 minutes ahead than actual timezone time,plz help mee.
Hi, can you teach me how to configure VPS? i’m having trouble because i dont have php.ini file in my public html
I found this helpful.
When no default is set, it goes to UTC. This is what I found with one server.
For another it was set to Germany/Berlin !
I updated php.ini, but phpinfo() did not update even when pressing F5, until I recycled apache. Then I went into the app and the times were correctly displayed.
how can i change the time zone to west africa as in nigeria,
i did not see it in the timezone list
What you are specifically looking for in this case for West Africa, and would be the same no matter where in the world you are is to find out first what your UTC offset is and then use one in the list that matches that. For example, I live in the Pacific Northwest in the USA and our offset is -7 (that is minus seven) and at present we are in Daylight Savings time (aka PDT). When not in DST time of year we are -8 PST.
So we are minus seven hours from GMT aka UTC which is at 0 and sometimes expressed +0.
Short answer is find your offset and use the one that matches. There are many and I think some with the same UTC offset.
I have set date.timezone = “America/New_York” in my php.ini and set it recursive in my .htaccess.. Still getting Los Angeles on my phpinfo page.
THank you,, it worked for me..
BR From Indonesia
GREAT! Now it works with my timezone! Thank you very much!
Best Regards from Brazil! 😀
I would like to know how to go back automactically to home page 3 seconds after submitting the data. I’d tried with header but it goes back and forth. Please guide me through that. Thanks a lot for your time.
I just moved my accounts to IM and am testing. I went to a Members Only login page and got two errors re: php that I am not getting on the old server. I checked the version of php and set it to the same 5.3 that it was using before.