Hi Reader's,
Welcome to FindNerd, today we are going to discuss set default timezone in CakePHP 2.x
When developing an application in CakePHP, sometimes we need to set default time zone in our applications, according to the timezone area.
This is a not a difficult task we can set timezone easily to follow below process.
Firstly we have to open our project directory like below
core.php file
Location: App =>Config=>core.php
After opening core.php file we will set timezone like below code
date_default_timezone_set('Asia/Calcutta');
Configure::write('TimeZone', 'Asia/Calcutta');
If we are using CakePHP 2.6 + version then change should be in bootstrap.php like below
bootstrap.php file
Location: App =>Config=>bootstrap.php
After opening bootstrap.php file we will set timezone like below code
date_default_timezone_set('Asia/Calcutta');
Configure::write('TimeZone', 'Asia/Calcutta');
I hope this blog will help you to set the timezone in your CakePHP application.
0 Comment(s)