Timezone settings are wrong! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Timezone settings are wrong! (/showthread.php?tid=58636) |
Timezone settings are wrong! - El Forum - 07-02-2013 [eluser]Unknown[/eluser] Just realised WHY my site is now showing all datetime variables as -1 hr... I'm using Codeigniter for the first time! (Never had this problem before) So, I have included the following code in my main index.php file Code: /* However, it's still showing as -1 hr, so I'm assuming I need to set some sort of default setting for MySQL... I have included the following line of code in my model: Code: function __construct() Still no difference... Help! My view code is: Code: <h3><?=date('D, jS F @ g:ia', strtotime($row->datetime))?></h3> The $row->datetime variable is nothing more than a DATETIME column value from my MySQL database. The echoed variable in view is ALWAYS 1 hour less than the value in my database... My model code is: Code: function coming_up() HELP! Timezone settings are wrong! - El Forum - 07-02-2013 [eluser]Syllean[/eluser] I'm not sure where you're located but I would guess that you are forgetting about daylight savings time. Europe/London time is not GMT time during Daylight Savings, it's GMT+1. |