Steps to change the date.timezone value in PHP

The most basic web development scripting language used to develop and implement logic into a HTML web page with object oriented language programming support called PHP. PHP is also called as Hypertext processor and it is a powerful tool for making dynamic and interactive Web pages. It is a server side scripting language where scripts are running at servers with the support of MySQL databases like MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc. to storre large databases. PHP files have a file extension of “.php”, “.php3”, or “.phtml”.

If your hosted webpage hosting application with PHP scripts doesn’t shows the correct time then it might possible that your hosting server is in a different timezone. This problem can be easily solved by updating a setting in PHP function called date.timezone. Depending on your Geo graphical location you can set a specific date.timezone value in PHP by using the following option which should be added to your local php.ini file:

The syntax is as follows :

date.timezone = “Specify the country or name of timezone”

For example assumes that you liked to set the timezone for your PHP scripts to UK. The full list of supported time zones are available in date.timezone and you should simply replace “UK” with the desired timezone.

Powered by BetterDocs