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

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...

what is mod security? How to fix the 403 forbidden error in WordPress?

Mod Security is a web app firewall (WAF). It monitors and blocks the malicious incoming...

How to make a strong password?

A strong password provides essential protection from financial fraud and identity theft. One of...

What is Mod_security and how to disable it?

Mod_security is a web application firewall that protects your website against various threats. It...

How to fix : HTTP Error 500.30 After Publishing the application from Visual Studio?

We can use the web deploy function of visual studio to publish our application to the production...

  • 0 Users Found This Useful

Was this answer helpful?