To set the timezone in Codeigniter, you can use the following steps:
- Open the application/config/config.php file in your Codeigniter project.
- Look for the $config['time_reference'] setting. By default, it is set to 'local'.
- Change the value of $config['time_reference'] to 'GMT'. This will set the default timezone to Greenwich Mean Time (GMT).
- Alternatively, you can also set the timezone to a specific timezone by setting $config['time_reference'] to a timezone string, such as 'America/New_York' for Eastern Time in the United States.
- Save the config.php file and the timezone will be set for your Codeigniter project.
Here's an example of what the
$config['time_reference'] setting might look like after you have set the timezone:
$config['time_reference'] = 'America/New_York';
You can find a list of all the supported timezones in the PHP manual at http://php.net/manual/en/timezones.php.