Php date plus 1 year outputting weird date?

$exdate = date("d/m/Y", strtotime("+ 365 day")).

$exdate = date("d/m/Y", strtotime("+ 365 day")); And the $exdate will be 15/12/2012 because 2012 is leap year which has 366 days.

The output of this is 15/12/2012 instead of 16/12/2012(that I want). Is this some kind of bug php have? Thanks for replying.

– sm21guy 2 days ago It can be years with 366 days) – garvey 2 days ago oh I see. Thanks – sm21guy 2 days ago.

$joindate = date("d/m/Y"); $exdate = date("d/m/Y", strtotime('+1 year')).

Try this: $date = strtotime("+365 day", strtotime("2011-12-16")); echo date("Y-m-d", $date).

Have a look at mktime() in the PHP manual (here) With it you can add days, months, years, hours, minutes and seconds to an existing date like this: $date = "2011-12-16"; $dateTime = strtotime($date); $day = date("d", $dateTime); $month = date("m", $dateTime); $year = date("Y", $dateTime) + 1; $hour = date("H", $dateTime); $minute = date("i", $dateTime); $second = date("s", $dateTime); $nextYearTime = mktime($hour, $minute, $second, $month, $day, $year); $nextDate = date("Y-m-d", $nextYearTime); You can also wrap this code (or variations on it) into a function for portability.

Thanks for your help. – sm21guy 2 days ago.

Your code can also work if you change format to "m/d/Y.

Try this line of code. $dateOneYearAdded = strtotime(date("Y-m-d", strtotime($currentDate)) . " +1 year"); echo "Date After one year: ".

Date('l dS \o\f F Y', $dateOneYearAdded). ""; Thanks.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions