time zone set in codeigniter
To set the time zone in CodeIgniter, you can follow the steps below:
Open the
config.php
file: This file is located in theapplication/config
directory of your CodeIgniter project.Search for the
$config['time_reference']
line: This line is responsible for setting the time zone reference in CodeIgniter.Set the time zone reference: By default, the value of
$config['time_reference']
is set to'local'
, which means it uses the server's time zone. You can change this value to'UTC'
if you want to use UTC time zone.Save the changes: Once you have made the necessary changes, save the
config.php
file.
That's it! You have successfully set the time zone in CodeIgniter. The time zone reference you set will be used throughout your application to handle date and time operations.