Reputation: 303
So I have a system that is mostly finished, just ironing out some final bugs. We have an issue that the program seems to be permanently set in the New York timezone.
I have this line of code in both core.php and bootstrap.php:
date_default_timezone_set("Australia/Melbourne");
But the system keeps reporting that it is in America/NewYork.
Can anyone help me set the timezone to Australia Melbourne?
Upvotes: 7
Views: 25157
Reputation: 671
As of CakePHP 3.x, the configuration for default timezone is found in config/bootstrap.php.
CakePHP uses the PHP timezone codes, which can be found in the PHP docs here: http://php.net/manual/en/timezones.php
For example, a server in Los Angeles will be configured like this: date_default_timezone_set('America/Los_Angeles');
Upvotes: 2
Reputation: 1304
Set timezone in App/Config/bootstrap.php (Cakephp 2.6+)
date_default_timezone_set('Europe/Dublin');
ini_set('date.timezone', 'Europe/Dublin');
//Configure::write('Config.timezone', 'Europe/Dublin');
Upvotes: 3
Reputation: 126
In the config/core.php
file of the app folder try the following with single quotes:
date_default_timezone_set('Australia/Melbourne');
Upvotes: 10
Reputation: 501
You can add this in config/core.php
:
Configure::write('Config.timezone', 'Europe/London');
Upvotes: 5