Re: Maintainer of Date_Calc

From: Date: Mon, 06 Aug 2001 00:18:34 +0000
Subject: Re: Maintainer of Date_Calc
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1309@lists.php.net to get a copy of this message
At 18:38 2001-08-05 +0200, you wrote:
Erik Hjortsberg wrote: Anyways, does anybody know any method of converting an arbitary number of days to a correct date, such as '2001-01-40' => '2001-02-09'? list($year, $month, $day) = split('-', $date); while ($day > ($d = DATE_Calc::daysInMonth($month, $year)) {
        $day -= $d;
        if ($month++ > 12) {
                $month = 1;
                $year++;
        }
} return implode ('-', array($year, $month, $day)); (that was coding directly in Netscape so don't expect it to work, just "wanna" help :-)
Thanks, although I was kinda tired when asking and didn't realize that Date_Calc::dateToDays and Date_Calc::daysToDate solved my problem. I appreciate the help anyways! /erik hjortsberg

« previous php.pear.dev (#1309) next »