How to set timezone in codeigniter?

Last updated 2 years, 5 months ago | 2265 views 75     5

Tags:- CodeIgniter

Codeigniter | Set timezone

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

date_default_timezone_set('your timezone');
 
<?php

// India timezone
date_default_timezone_set('Asia/Kolkata');

?>