e1seix Posted January 6, 2010 Share Posted January 6, 2010 simply really. I need a code that can tell me if a certain variable is more than 7 days old and return a true if ( (time() - mktime($certain_date) > _____ ) { echo "true"; } Or something along those lines. All help appreciated. Link to comment https://forums.phpfreaks.com/topic/187487-timestamp-minus-7-days/ Share on other sites More sharing options...
salathe Posted January 6, 2010 Share Posted January 6, 2010 How about if ($time < strtotime('-7 days')) …? Link to comment https://forums.phpfreaks.com/topic/187487-timestamp-minus-7-days/#findComment-989970 Share on other sites More sharing options...
greatstar00 Posted January 19, 2010 Share Posted January 19, 2010 if ( (time() - mktime($certain_date) > 86400*7 ) {echo "true"; } //note, 86400 is second in a day, times 7, it is the seconds in a week Link to comment https://forums.phpfreaks.com/topic/187487-timestamp-minus-7-days/#findComment-998261 Share on other sites More sharing options...
roopurt18 Posted January 22, 2010 Share Posted January 22, 2010 I hate to burst your bubble, but there are 86400 seconds in most days and not in all of them. Link to comment https://forums.phpfreaks.com/topic/187487-timestamp-minus-7-days/#findComment-999673 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.