Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Discussion on set default timezone in cakephp 2.x

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 449
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: