Problem
I use the code below to get the next date of the week and second week. It works great for the first recordings, but the year 1970 later begins.
If the start date is 12/01/2013 , this shows me the result of coorect, which:
Next week: 01/19/2013
Second week: 01/26/2013
but in another entry where the date 05/16/2013 is displayed below
Next Week: 08/01/1970
Second week: 15/01/1970
Please tell me where can I make a mistake?
code
//Date of when game started $starts_on = '12/01/2013'; //Next week date from start date $next_week = strtotime(date("d/m/Y", strtotime($starts_on)) . "+1 week"); $next_week = date('d/m/Y', $next_week); //Second week date from start date $second_week = strtotime(date("d/m/Y", strtotime($starts_on)) . "+2 week"); $second_week = date('d/m/Y', $second_week); echo $starts_on.", ".$next_week.", ".$second_week;
source share