When calling php in command line with /usr/bin/php, it worries about my timezone settings. I checked with phpinfo() and looked up the php.ini. I would like to use CEST as timezone and wrote;
date.timezone = CEST
Do You see a mistake?
The default timezone for PHP is UTC regardless of your server's timezone. This is the timezone used by all PHP date/time functions in your scripts.
It's really simple to convert a DateTime from one time zone to another in PHP. Just create a DateTime object using date & time to be converted as the first parameter and the original time zone as the second parameter. Then change the time zone to the desired one using the setTimezone method. That's all!
date.timezone = 'Europe/Berlin';
will give you what you want. As @nickb has mentioned, 'CEST' is not a supported timezone. Also, do not forget the quotes, it has to be a valid string.
Your problem is that the CEST timezone is not on the list of supported timezones.
You can use CET, which is supported, but I'm not sure how that affects your use case.
date.timezone = "CET"
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