I am working in a php project using codeigniter. Please advise me what is the global way to set time zone for php and mysql . In which file I can set this. I want to set it without php.ini and .htaccess file.
currently I am using this before every entry -:
date_default_timezone_set("Asia/Kolkata");
$time = Date('Y-m-d h:i:s');
Placing this
date_default_timezone_set('Asia/Kolkata');
on config.php above base url also worksPHP List of Supported Time Zones
application/config/config.php
Another way I have found use full is if you wish to set a time zone for each user
Create a MY_Controller.php
create a column in your user table you can name it timezone or any thing you want to. So that way when user selects his time zone it can can be set to his timezone when login.
application/core/MY_Controller.php
Also to get the list of time zones in php