RE: [PHP] Incrementing a date value

From: Date: Sat, 11 Nov 2000 22:42:51 +0000
Subject: RE: [PHP] Incrementing a date value
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24810@lists.php.net to get a copy of this message
I've answered my own question, but for the sake of completeness for future archive searches, here's the answer: I wrote a function called by "increment_date($date,7)" the function is: function increment_date ( $dt, $num ) { //code to increment a date $dt by $num days $t=mktime(0,0,0,substr($dt,4,2),(substr($dt,6,2)+$num),substr($dt,0,4) ); $newdate=date("Ymd",$t); return $newdate; } Chris Mason Box 340, The Valley, Anguilla, British West Indies Tel: 264 497 5670 Fax: 264 497 8463 USA Fax (561) 382-7771 Take a virtual tour of the island http://net.ai/ The Anguilla Guide Find out more about NetConcepts www.netconcepts.ai Talk to me in real time with Instant Messenger: masonc92@hotmail.com -----Original Message----- From: php-general-return-24790-chris=net.ai@lists.php.net [mailto:php-general-return-24790-chris=net.ai@lists.php.net]On Behalf Of Chris Mason Sent: Saturday, November 11, 2000 2:17 PM To: PHP Subject: [PHP] Incrementing a date value I have a date value in the form 2001128 which I would like to be able to add seven days to. Of course, if I just add 7 I get a mnonth with 35 days! What's the proper way to do this? Chris Mason Box 340, The Valley, Anguilla, British West Indies Tel: 264 497 5670 Fax: 264 497 8463 USA Fax (561) 382-7771 Take a virtual tour of the island http://net.ai/ The Anguilla Guide Find out more about NetConcepts www.netconcepts.ai Talk to me in real time with Instant Messenger: masonc92@hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#24810) next »