Re: dst and strtotime

From: Date: Tue, 13 Mar 2007 16:42:44 +0000
Subject: Re: dst and strtotime
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-250456@lists.php.net to get a copy of this message
On 3/13/07, Jake McHenry <linux@nittanytravel.com> wrote:
-----Original Message----- From: Jake McHenry [mailto:linux@nittanytravel.com] Sent: Tuesday, March 13, 2007 11:22 AM To: For users of Fedora; PHP-General Subject: Re: [PHP] dst and strtotime A little more info:
strtotime("last monday")      or yesterday, is correct, but
strtotime("last sunday") gives me 3/10 (saturday), strtotime("last saturday") gives me 3/9 (Friday), "last friday" gives me 3/8 thursday...... etc. maybe it will go away after a week??????
What is the output of the below? echo date("Y-m-d g:i A T", time()); echo date("Y-m-d g:i A T", strtotime("last sunday")); 2007-03-13 12:30 PM EDT 2007-03-10 11:00 PM EST Hmm, EST and EDT ?
There's the problem i think, as it is 11PM, making it 12PM it means next day. You could fix this with adding 24*60*60 to the result of strtotime() , or change it somehow ... So this would give you the right date: echo date("Y-m-d g:i A T", strtotime("last sunday") * 24*60*60); Tijnema Tijnema
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#250456) next »