Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set default timezone in cakephp?

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?

like image 626
user2787386 Avatar asked Mar 25 '14 03:03

user2787386


People also ask

How do I set default timezone?

The date_default_timezone_set() function sets the default timezone used by all date/time functions in the script.

What is the 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.

What is the default timezone in PHP?

The date_default_timezone_get() function returns the default timezone used by all date/time functions in the script.


Video Answer


1 Answers

In the config/core.php file of the app folder try the following with single quotes:

date_default_timezone_set('Australia/Melbourne');
like image 75
kythan06 Avatar answered Sep 18 '22 21:09

kythan06