RE: [PHP] Incrementing dates

From: Date: Sun, 22 Apr 2001 08:15:14 +0000
Subject: RE: [PHP] Incrementing dates
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49728@lists.php.net to get a copy of this message
You can (mySQL, right?) do the following: UPDATE table SET date=(date+INTERVAL 10 DAYS); so if date there was 04-28, it will be added 10 more days and so will become 05-08 Use SQL for this things, it treats dates as 'dates' while PHP treats them as integers and strings. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) maxim@phpbeginner.com www.phpbeginner.com -----Original Message----- From: Martin Skjoldebrand [mailto:chimbis@skjoldebrand.org] Sent: Sunday, April 22, 2001 7:13 AM To: php-general@lists.php.net Subject: [PHP] Incrementing dates How do I increment dates past the turn of the month (or year)? Say I've got a booking of equipment A for the 28 April to 5 May and want to add each instance to a calendar (mysql table). Can I increment the variable (format 2001-04-28) holding the date ($txtDate++) somehow so that it doesn't add the 31, 32 and 33 of April? Martin S. -- 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 (#49728) next »