PHP has date_default_timezone_set() function that we can use to set the default timezone.
Here’s how to use this function:
date_default_timezone_set("America/Chicago");
echo date_default_timezone_get();
//America/Chicago
//OR
date_default_timezone_set("UTC");
echo date_default_timezone_get();
//UTC
Be careful, when you set the timezone, it will set in all date functions used inside the page. No matter what country it is, it will be that set timezone in all date functions.
Here is the list of all supported timezones.
It will return FALSE is you don’t pass the valid timezone.
date functions timezone