Page 1 of 1

time() and daylight saving time

Posted: Wed Jan 25, 2006 7:14 am
by tores
Hi,

Does time() follow daylight saving time?

If no: Will I have to add one hour to the time returned by time() during daylight saving time?
If yes: Will time() state that time goes backwards one hour when going from daylight saving time to standard time?

regards tores

Posted: Wed Jan 25, 2006 7:24 am
by feyd
yes.. and no :)

The time returned is based on the server's settings. If it is set to follow daylight savings, it will. Otherwise, it won't. date() can tell you if you are in daylight savings mode or not.

Posted: Wed Jan 25, 2006 7:55 am
by timvw
http://www.php.net/gmmktime[url] and [u ... net/gmdate can come in very handy. This way you can always calculate the required offset yourself... With the upcoming improvements of date and time management in php this will become easy ;) (untill then you'll have to add your own offsets and/or daylight saving settings)