jeff5656 Posted November 24, 2010 Share Posted November 24, 2010 I want to see if a date is more than 10 days overdue. if ($row['duedate'] < "todays date plus 10 days"){ How do I do that? I put in quote sup there in "english" what I want... Link to comment https://forums.phpfreaks.com/topic/219732-check-if-a-date-is-10-days-beyond-another-date/ Share on other sites More sharing options...
Rifts Posted November 24, 2010 Share Posted November 24, 2010 if ($row['duedate'] < $row['duedate']+10){ Link to comment https://forums.phpfreaks.com/topic/219732-check-if-a-date-is-10-days-beyond-another-date/#findComment-1139116 Share on other sites More sharing options...
jeff5656 Posted November 24, 2010 Author Share Posted November 24, 2010 No that didnt work. That just gives me the number 10. incidentally if I do echo date ("Y-m-d" + 10); I get back "10". Link to comment https://forums.phpfreaks.com/topic/219732-check-if-a-date-is-10-days-beyond-another-date/#findComment-1139120 Share on other sites More sharing options...
Pikachu2000 Posted November 24, 2010 Share Posted November 24, 2010 if ($row['duedate'] < $row['duedate']+10){ That won't work. It will always return TRUE. It's the same as saying "if x is less than (x + 10)". Link to comment https://forums.phpfreaks.com/topic/219732-check-if-a-date-is-10-days-beyond-another-date/#findComment-1139123 Share on other sites More sharing options...
jdavidbakr Posted November 24, 2010 Share Posted November 24, 2010 I want to see if a date is more than 10 days overdue. if ($row['duedate'] < "todays date plus 10 days"){ How do I do that? I put in quote sup there in "english" what I want... Assuming $row['duedate'] is a DATE or DATETIME format: if (strtotime($row['duedate']) < strtotime("+10 days")) { ... } Link to comment https://forums.phpfreaks.com/topic/219732-check-if-a-date-is-10-days-beyond-another-date/#findComment-1139126 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.