add two date using datetime php class -


i need add 30 days 2014-03-06.

i've done below code:-

$due_dt = new datetime("2014-03-06"); $act_dt = $due_dt->add("+30 days"); 

this code giving below error:-

message: datetime::add() expects parameter 1 dateinterval, string given 

any please...

use datetime::modify

$date = new datetime('2014-03-06'); $date->modify('+30 days'); echo $date->format('y-m-d'); 

Comments

Popular posts from this blog

python - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -

node.js - Nodejs javascript implementation of PBEWithMD5AndTripleDES/CBC/PKCS5Padding -