![]() |
DST bool for gmt_to_local function in date helper - 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: DST bool for gmt_to_local function in date helper (/showthread.php?tid=50326) |
DST bool for gmt_to_local function in date helper - El Forum - 03-22-2012 [eluser]ToretoTech[/eluser] Hey All! I'm implementing some functionality for the users on my website so that they can have the ability to see all timestamps using their local timezone offset. I decided to store the codes from the CI timezone reference in their user profile. All system timestamps are stored in UTC unix format. When displaying the timestamps to the users, I call the helper function gmt_to_local. The problem I'm encountering is the the third parameter of this function which is a bool for DST. How can I know if the user's timezone is currently using DST or not? I've tried a multitude of ways using the PHP date and timezone classes but nothing is working. It's also difficult to use the native PHP functions because I would have to translate from the CI timezone offsets to the PHP timezones which are the names of countries and cities. Any help would be greatly appreciated! Thanks! |