CodeIgniter Forums

Full Version: How do you change the timezone?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any Codeigniter way to change the entire website time zone?
Thanks for your time :=)
Or use php's date_default_timezone_set() as the very first line of index.php. That will work using any webserver because it's at the php level, while htaccess only works with apache webservers.
http://php.net/manual/en/function.date-d...ne-set.php
(07-19-2015, 09:46 AM)rakibtg Wrote: [ -> ]Is there any Codeigniter way to change the entire website time zone?
Thanks for your time :=)

I find that for changing the default time zone is best to add this


Code:
date_default_timezone_set('Australia/Queensland');

On to the config.php file Example I use Country/State


PHP Code:
<?php

defined
('BASEPATH') OR exit('No direct script access allowed');

date_default_timezone_set('Australia/Queensland');

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
| If this is not set then CodeIgniter will try guess the protocol, domain
| and path to your installation. However, you should always configure this
| explicitly and never rely on auto-guessing, especially in production
| environments.
|
*/
$config['base_url'] = ''
Keep in mind that you may also need to change mysql's timezone if you are using MySQL.
Thanks everyone, and special thanks goes to @skunkbad.
Once i changed the timezone then the entire website started to show inappropriate date, now after changing the mysql timezone its perfect now!