When your CodeIgniter project is hosted on shared server, you haven’t able to modify the php.ini
file. But many times you needs to modify the server settings for your project. The commonly required changes are timezone setting. We’ll show you the simplest way to change the timezone in CodeIgniter project.
PHP date_default_timezone_set()
function is used to sets the default timezone used by all date or time functions. In CodeIgniter, the best place to set the timezone is index.php
file of application root.
Place the date_default_timezone_set()
with your desired timezone in the main index.php
file of your application.
<?php
date_default_timezone_set('Asia/Kolkata');
?>
Awsome
Nice Tutorial
Hi, thanks its working.
hi i need to change my timezone to india timezone but my production server database showing singapore timezone i tried all the possibility but i cant get india time zone. below my code
date_default_timezone_set(‘Asia/Kolkata’); // but this is not work out. please help me out of this issue
thanks team its working in codeingater
Hi, thanks for sharing this needful article with us. I have resolved my problem. it’s really helpful