PHP and new time changes


Does PHP know about the new Daylight savings time changes?
I noticed a problem when I advanced my time locally to check this…



I don’t think it does, but as far as I know, the time() function uses the machine’s time stamp (the computer PHP is installed on), so it depends on the underlying OS (and if I have to believe an article I read recently, Windows does not support the new DST settings). But I’m pretty sure you can use a little script to fix it. Something like this:

if (date(“n”) >= 3 && date(“n”) <= 4) { $time = time() + 3600; }

Not saying this works, but with a little smarts in a logical mind, you should be able to figure it out :)


Thanks for the reply…
I contacted my host, and they already have applied a patch to their installed version of PHP.

The code in question will now work:

<input type="hidden" name="back7" value="<?php $ok = strtotime("-7 days", $ok2); echo $ok; ?>" />

where $ok is timestamp I will work with, and $ok2 gets passed to a function.