Welcome Guest, Not a member yet? Register   Sign In
How do you change the timezone?
#1
Lightbulb 

Is there any Codeigniter way to change the entire website time zone?
Thanks for your time :=)
Reply
#2

Have you tried with htaccess?
http://www.htaccess-guide.com/setting-server-timezone/
Reply
#3

(This post was last modified: 07-19-2015, 11:21 AM by CroNiX.)

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
Reply
#4

(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'] = ''
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#5

Keep in mind that you may also need to change mysql's timezone if you are using MySQL.
Reply
#6

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!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB