Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

adding n days to a DATETIME format value

$n = 10;	// add 10 days for existing date
$datetime = new DateTime('2013-01-29');
$datetime->modify('+'.$n.' day');

echo $datetime->format('Y-m-d H:i:s');	// 2013-02-08 00:00:00
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #adding #days #DATETIME #format
ADD COMMENT
Topic
Name
6+7 =