Re: Date question?

From: Date: Fri, 12 Sep 2003 18:16:08 +0000
Subject: Re: Date question?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-21380@lists.php.net to get a copy of this message
you also can do <? $date_as_string = "2003-04-02"; $temp = explode("-", $date_as_string); // Cuts your String at '-' and stores it in the $temp - Array $date_as_timestamp = mktime(1,0,0,$temp[1], ($temp[2]+9), $temp[0]); // contains the timestamp to the date 9 Months ahead echo date("Y-j-n", $date_as_timestamp); // puts out the date in this form: Year-Days-Month ?> check out date() and mktime() in the php manual... oh yeah and i supposed 2003-04-02 to mean February 4th 2003 if i'm wrong you have to change the mktime line.. ----- Original Message ----- From: "Disko_kex" <disko_kex@swedish-mushroom.com> To: <php-windows@lists.php.net> Sent: Friday, September 12, 2003 3:50 PM Subject: [PHP-WIN] Date question? > Hi > > If I have a date (2003-04-02) and want to select 9 months later, how to > do? > > Thanks. > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.windows (#21380) next »