phpisawesome Posted November 18, 2008 Share Posted November 18, 2008 I'm trying to do a query in php...how do I check if something is 2 weeks using the php date function? Link to comment https://forums.phpfreaks.com/topic/133139-date/ Share on other sites More sharing options...
cooldude832 Posted November 18, 2008 Share Posted November 18, 2008 2 weeks = 60 seconds * 60 minutes * 24 hours * 14 days = 1209600 seconds so go <?php $date1 = date("U",DATESTAMP FORM HERE); $date2 = date("U",DATESTAMPE FORM HERE); if($date-$date1 < 1209600){ #within 2 weeks } else{ #not within 2 weeks } ?> Link to comment https://forums.phpfreaks.com/topic/133139-date/#findComment-692441 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.