I did not know what forum to put this in. Here is my problem. I am trying to add one year from a date that is outputted from the database. $date is the date taken from my database. Whenever I output this to page all I keep getting is 1970-01-01
<? print date("Y-m-d", strtotime('$date + 1 year'));?>
Any ideas on this.
You cant use $date inside ' ' because then php doesnt return the actual date, just $date. Try it like this: <? print date("Y-m-d", strtotime($date.' + 1 year'));?>
That's brilliant thank you very much for your help. I have been scratching my head over this one.
Again Thank you.
$theDate = explode("-","1970-01-01"); echo date("d.m.Y",mktime(0, 0, 0, $theDate[1], $theDate[2], $theDate[0]+1));