How to modify the PHP timezone setting?

If your website is hosted on shared hosting, you may not be able to change the Global time configuration of that server. However, you can surely add a PHP function called date_default_timezone_set for your website. Please refer to the following code to set the time zone that you required. 

<?php
date_default_timezone_set("America/Denver");
echo date_default_timezone_get();
?>

You can get the list of PHP timezone details from PHP > Timezone.

Related Articles

What are the Differences Between Forward Proxy and Reverse Proxy?

Generally, there are two types of proxy servers available which are Forward Proxy and Reverse...

Diagnostic Tools - Check Website Connection, Website Availability

Ping Ping is a command to check whether a destination computer system is working on a network or...

Receiving unexpected T_STRING error.

If you are receiving this error, this means .html files are parsed as PHP. In case, your .html...

How to enable "I'm Under Attack" mode in CloudFlare Panel?

Cloudflare provides additional protection called "I m under attack" for a website which is under...

How to resolve question marks and mysterious symbols on my site?

If you are seeing some strange symbols that are displaying on your site, it is due to incorrect...

  • 0 Users Found This Useful

Was this answer helpful?