RE: [PHP] dst and strtotime
| From: | Brad Fuller | Date: | Tue, 13 Mar 2007 17:21:47 +0000 |
| Subject: | RE: [PHP] dst and strtotime | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-250473@lists.php.net to get a copy of this message | ||
Jake McHenry wrote:
> Why would one give me EST and the other EDT?
Because EDT did not kick in until 2 or 3 AM on 3/11.
PHP is compensating for DST by subtracting 1 hour, because php sees "last
sunday" as 12:00 AM on 3/11. Subtract 1 hour and you get 11:00 PM on 3/10.
> +60*60 worked after strtotime for a temp fix, but I'm probably going to do
> the update to php5 finally....hopefully it doesn't break anything I've
> created... like i need more work to do.. lol
>
> thanks for all the help :)
>
> Jake
I wouldn't be in too big of a hurry to upgrade unless you're sure that none
of your existing code will break... Search the archives or the web for
details.
I'm not sure how I would go about fixing this, perhaps replacing "last
sunday" with "minus x days" (where x is derived from the day of the week)
HTH,
Brad