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 to add/host a website to VPS and point the domain to VPS?

Point 1: How to Add Website & Use Name Server of your VPS? (1) Host a website in the...

"which" command in Linux

which is a powerful command used in SSH environment to find out path of perl script, php...

PHP Fatal error: Cannot redeclare

If your browser saw an error message PHP Fatal error: Cannot redeclare function it is an issue...

Why is my Autossl failing in cPanel?

ERROR Local DNS DCV error (mail.example.com): The DNS query to...

How to register domain and make the payment?

If you are a registered client, you can directly refer to the following steps to order a new...

  • 0 Users Found This Useful

Was this answer helpful?