set timezone in codeigniter – how to set timezone in codeigniter?

set timezone in codeigniter – PHP date_default_timezone_set() function is used to sets the default timezone used by all date or time functions.

How to set timezone in codeigniter?

To set default timezone in PHP Codeigniter, you can add the simple PHP method Like date_default_timezone_set() function in your application/config.php or index.php file.

You are required to use the date.timezone setting or the date_default_timezone_set() function.

date_default_timezone_set(‘asia/kolkata’) in codeigniter

Codeigniter | Set timezone

date_default_timezone_set('your timezone');

EXAMPLE


application/config/config.php


date_default_timezone_set for india in php laravel

config/app.php

 replace timezone
 'timezone' => 'Asia/Kolkata'

date_default_timezone_set for india in php


PHP List of Supported Time Zones : PHP DateTimeZone

I hope you get an idea about set timezone in codeigniter.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment