HOSTING

Feb 13 2020

Setting the Timezone for PHP in the File, InMotion Hosting, hosting php.

#Hosting #php



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.

  1. Open your php.ini file with the File Manager in cPanel

Hosting php

Hosting php

If you need further assistance please feel free to ask a question on our support center.

News / Announcements

Support Center Login

Social Media Login

Related Questions

Hosting php

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?

Hosting phpHosting php

Hosting php

Great tutorial. This tutorial was really useful to set timezone.

Hosting php

Nice tutorial.This tutorial was really helpful to me on set timezone.

Hosting php

I set timezone as asia/kolkata in my server but it showing 4 minutes ahead than actual timezone time,plz help mee.

Hosting phpHosting php

Hosting phpHosting phpHosting php

Hosting phpHosting phpHosting php

Hosting php

Hi, can you teach me how to configure VPS? i’m having trouble because i dont have php.ini file in my public html

Hosting phpHosting php

Hosting php

Hosting php

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.

Hosting php

how can i change the time zone to west africa as in nigeria,

i did not see it in the timezone list

Hosting php

Hosting php

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.

Hosting php

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.

Hosting phpHosting php

Hosting php

THank you,, it worked for me..

BR From Indonesia

Hosting php

GREAT! Now it works with my timezone! Thank you very much!

Best Regards from Brazil! 😀

Hosting php

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.

Hosting phpHosting php

Hosting php

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.



Written by admin


Leave a Reply