lynxus Posted February 8, 2011 Share Posted February 8, 2011 Hi Guys, Need some help I have two dates: Now= 2011-02-08 Expires= 2011-06-15 How can I check if we are getting close to the expire date. For example. Lets say we were 5 days away from 2011-06-15 ( todays date was 2011-06-10 ) for example.. How can i tell this? / return 1 Ie: if date is 5 days or less away do ( this ) Its s essentially so i can email people when something is due to expire. Many thanks L Link to comment https://forums.phpfreaks.com/topic/227064-check-if-a-date-is-near-todays-date/ Share on other sites More sharing options...
Maq Posted February 8, 2011 Share Posted February 8, 2011 Add 5 days to 'now' and check to see if it is greater than 'expire'. Check out this tutorial: http://www.brightcherry.co.uk/scribbles/2009/01/06/php-adding-and-subtracting-dates/ You can use logical operators when dates are in strtotime format. Link to comment https://forums.phpfreaks.com/topic/227064-check-if-a-date-is-near-todays-date/#findComment-1171447 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.