Why in now that date is 2011/10/31 codeigniter display to me date 2011/10/30, by following code.
<?php
echo date("Y/m/d");// Output in codeigniter is: 2011/10/30
?>
How can I make it output my date and not the server's date?
Why in now that date is 2011/10/31 codeigniter display to me date 2011/10/30, by following code.
<?php
echo date("Y/m/d");// Output in codeigniter is: 2011/10/30
?>
How can I make it output my date and not the server's date?
In all of my applications, I set the default timezone using this function: (usually, as you suggested, in a 'config' or 'init' file)
date_default_timezone_set('America/Los_Angeles');
The basic idea is to run that once every time your application loads, and before any times are calculated/parsed; You know your applications best, and so will need to decide the best way to achieve this.
For example just set it in the php.ini
or for codeigniter in config/config.php
.