I noticed today that the date reported by PHP is wrong.
When I went into the PHP file to try to change the timezone, I get a big ugly warning saying it is mandatory to set the timezone.
I get no error when the timezone is set to UTC but the date is wrong.
Every other value besides UTC throws the error.
What is this?
The date_default_timezone_set() function sets the default timezone used by all date/time functions in the script.
US' Default Time Zone Unfortunately, there is no default time, so you have to change your time depending on the time zone used in the place.
Definition and Usage. The date_default_timezone_get() function returns the default timezone used by all date/time functions in the script.
date.timezone = "Europe/Paris"
Put that in your php.ini file with the approrpriate timezone from here, and then restart your HTTP server.
If you don't want to set it globally, but want to set it on a script-by-script basis, use this code on each page where a date/time function is used:
date_default_timezone_set('America/Los_Angeles');
Like the global timezone setting, pick your timezone from here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With