I got a strange problem with Cake. I live in Germany. When I add posts the time in the "created" database-field is 6 hours back. E.g. a post created 6pm shows up in the database as created 12am. I use a managed server and I contacted the company which set the php.ini to the correct timezone Europe/Berlin. When I request the servers php.ini, it shows the timezone "Europe/Berlin" correctly. But when I run the code
$timezone = date_default_timezone_get();
echo "The current server timezone is: " . $timezone;
in CakePHP it shows
The current server timezone is: America/New_York
I already tried to set in the core.php:
date_default_timezone_set('Europe/Berlin');
But that has no effect at all. Hopefully someone knows what to do.
EDIT 1:
After asking the support to run "locale -a", following was spit out:
# locale -a
C
de_DE
de_DE@euro
de_DE.iso88591
de_DE.iso885915@euro
de_DE.utf8
deutsch
en_US.utf8
german
POSIX
I assume that serverside everything is fine and the error is cake-wise. But I don´t have a clue what to do next? Maybe someone can help. Thanks in advance.
** EDIT 2: **
After looking around what it could be I found the error in the bootstrap.php of the Usermanagement-plugin, which set the timezone there to UTC. So everything works fine now. Thanks for your help anyway.