How can I get a date one year into the future
if today is 2003-03-13 I want 2004-03-13
I could do
date("Y")+1 date("m") date("d")
but I think that can be wrong because of leaf year and so on,
Have looked at mktime(), but I am yet not getting it,
can someone help me out
please 🙂
best regards Thomas
use the mktime() function
int mktime ( int hour, int minute, int second, int month, int day, int year [, int is_dst])
so...
$futuredate = mktime (0,0,0, date("m"), date("d"), date("Y")+1); echo date("d/m/Y", $futuredate);
$stamp=strtotime("+1 year"); echo date('Y-m-d',$stamp);