$start_date = '2012-06-16'; $end_date = '2012-09-01'; $min_length = strtotime('+10 weeks'); $min_end_date = date('$start_date', $min_length); $max_length = strtotime('+15 weeks'); $max_end_date = date('$start_date', $max_length); echo "Start date: $start_date <br />"; echo "End date: $end_date <br />"; echo "Min Length: $min_end_date <br />"; echo "Max Length: $max_end_date <br />"; if($end_date>$min_end_date&&$end_date<$max_end_date) echo "You're good!"; else echo "You are not good!";
Sorry if this is a stupid question but I've been looking and I'm convinced it's right. I run it and the min/max length values are what they should be, but the conditional statement does not return what I think it should.
Thanks in advance.
Also, sorry if it wasn't obvious...
I'm trying to determine if two dates that are input (the start and end dates) are no further apart then 15 weeks (max length) but no less then 10 weeks apart (min length)