Re: strtotime

From: Date: Wed, 25 Oct 2006 15:41:39 +0000
Subject: Re: strtotime
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-243617@lists.php.net to get a copy of this message
On 24 Oct 2006, at 19:07 , Brad Chow wrote:
$date=("2006-10-26"); $date=strtotime($date); $date=date('Y-m-1',$date); $now=strtotime("+3 month", strtotime($date)); $lastday=strtotime("-1 day", $now); echo date('Y-m-d',$lastday); //2006-12-31
Yep, that's pretty much exactly what I do. I suspect there is a much shorter, and more opaque but elegantly clever way of doing it, but that basic methodology has been with me since the mid 80's :) -- One by one the bulbs burned out, like long lives come to their expected ends.

« previous php.general (#243617) next »