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

How Can I Test My Website Before Switching DNS?

It is always important to test your website on a new web host before you change the Nameservers...

what are the supported OS for the .net 5?

Microsoft released the .Net 5.0 on 12th December 2020. You can download the new version of .Net...

How to Remove IP Address from Gmail Blacklist?

If you are receiving bounce back emails from Gmail, your IP address might be on the Gmail...

How to check VPS bandwidth usage from Accuwebhosting Client area?

You can easily view your VPS bandwidth report from the bandwidth meter tool. Please refer to the...

What is the difference between unmetered and unlimited bandwidth?

What is Bandwidth? In web hosting, bandwidth means the data transfer of your website to users in...

  • 0 Users Found This Useful

Was this answer helpful?