![]() |
now() & local_to_gmt - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: now() & local_to_gmt (/showthread.php?tid=61248) |
now() & local_to_gmt - Tecvid - 04-04-2015 i have looked the date helper code and wondered: both now() and local_to_gmt() functions are return the same thing (i have set 'gmt' in config): PHP Code: mktime(gmdate("H", $now), gmdate("i", $now), gmdate("s", $now), gmdate("m", $now), gmdate("d", $now), gmdate("Y", $now)); but now() displays the Greenwich time, local_to_gmt() displays the time in my country, how can it be?? i just wanna times to be stored by Greenwich in db, but to be shown according to the country the user is located, and now i am confused how to do it, which is the best way to realize it? |