CodeIgniter Forums
Daylight saving time - 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: Daylight saving time (/showthread.php?tid=5308)



Daylight saving time - El Forum - 01-16-2008

[eluser]jabre[/eluser]
Hello,
I have a question on the gmt_to_local() and local_to_gmt() functions in the date helper:
Does these functions consider the change between normal and daylight saving time automatically if I set daylight_saving to true? Or do I have to change it every time by submitting true or false?


Daylight saving time - El Forum - 01-16-2008

[eluser]tonanbarbarian[/eluser]
Why not look at the code yourself?

its in system/helpers/date_helper.php

if you do you will find that local_to_gmt does not take into account dst only gmt_to_local dos. If $dst is set to true it always adds 3600 seconds (1 hour)


Daylight saving time - El Forum - 01-16-2008

[eluser]jabre[/eluser]
Thanks for helping.

[quote author="tonanbarbarian" date="1200544912"]Why not look at the code yourself?[/quote]

It's night here in Cologne, and it was a whole day of coding - the simplest solutions doesn't come to my mind. I should go to bed Wink .