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? Quote 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? Quote 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. Quote 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 Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/84745-solved-question-about-dates/#findComment-431868 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.