JSHINER Posted January 6, 2008 Share Posted January 6, 2008 I am doing the following: <?php $now = date("m-d-Y"); if(date('m-d-Y', strtotime($event)) >= $now) { echo 'date('m-d-Y', strtotime($event))'; } ?> Which prior to January 2008 seemed worked fine only displaying $event that were in the future. How can I get this to work again now that it's 2008? Link to comment https://forums.phpfreaks.com/topic/84745-solved-question-about-dates/ Share on other sites More sharing options...
revraz Posted January 6, 2008 Share Posted January 6, 2008 What does $event contain? Link to comment https://forums.phpfreaks.com/topic/84745-solved-question-about-dates/#findComment-431861 Share on other sites More sharing options...
JSHINER Posted January 6, 2008 Author Share Posted January 6, 2008 Event contains a date. Link to comment https://forums.phpfreaks.com/topic/84745-solved-question-about-dates/#findComment-431863 Share on other sites More sharing options...
revraz Posted January 6, 2008 Share Posted January 6, 2008 Post the format. You shouldn't compare dates in MM/DD/YYYY format, you should compare them YYYY/MM/DD Link to comment https://forums.phpfreaks.com/topic/84745-solved-question-about-dates/#findComment-431866 Share on other sites More sharing options...
JSHINER Posted January 6, 2008 Author Share Posted January 6, 2008 Compared in YYYY/MM/DD and it worked. Thanks! Link to comment https://forums.phpfreaks.com/topic/84745-solved-question-about-dates/#findComment-431868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.