Jump to content

[SOLVED] Php date function wrong time


onenonly

Recommended Posts

Instead of using this function to set the default timezone in your script, you can also use the INI setting date.timezone to set the default timezone.

 

http://kb.siteground.com/article/How_to_change_the_datetimezone_value_in_PHP.html

 

If your PHP scripts do not show the correct time, the reason is that most probably your hosting server is in a different timezone. This can be easily resolved by changing a setting in PHP called date.timezone.

 

 

 

Depending on your location you can set a specific date.timezone value in PHP using the following option which should be added to your local php.ini file:

 

 

 

date.timezone = "US/Central"

 

 

 

The above example assumes you'd like to set the timezone for your PHP scripts to US/Central. The full list of supported time zones is available here and you should simply replace "US/Central" with the desired timezone.

Link to comment
Share on other sites

Instead of using this function to set the default timezone in your script, you can also use the INI setting date.timezone to set the default timezone.

 

http://kb.siteground.com/article/How_to_change_the_datetimezone_value_in_PHP.html

 

If your PHP scripts do not show the correct time, the reason is that most probably your hosting server is in a different timezone. This can be easily resolved by changing a setting in PHP called date.timezone.

 

 

 

Depending on your location you can set a specific date.timezone value in PHP using the following option which should be added to your local php.ini file:

 

 

 

date.timezone = "US/Central"

 

 

 

The above example assumes you'd like to set the timezone for your PHP scripts to US/Central. The full list of supported time zones is available here and you should simply replace "US/Central" with the desired timezone.

 

 

 

do you do that once and its permanent? or you must put it on top of all your script?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.