Re: strtotime bug? end of the month.

From: Date: Thu, 31 Oct 2002 18:14:22 +0000
Subject: Re: strtotime bug? end of the month.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-122294@lists.php.net to get a copy of this message
Actually I only needed date("Y-m") so my solution works fine, and I didn't consider the problems with hard coding 1 into it. But thanks for the replies. On Thu, 2002-10-31 at 11:33, Jeff Bearer wrote: > date("Y-m-d",strtotime("+1 month")) > > returns December 1st! This happens when you add 1 month to any day that > doesn't exist in the next month. Quite annoying that you have to handle > it like this: > > date("Y-m-d",strtotime("+1 month",strtotime(date("Y-m-1")))) > > > -- > Jeff Bearer, RCHE > Webmaster, PittsburghLIVE.com > Winner 2002 Eppy Award, Best U.S. Newspaper Website > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Jeff Bearer, RCHE Webmaster, PittsburghLIVE.com Winner 2002 Eppy Award, Best U.S. Newspaper Website

« previous php.general (#122294) next »