Drongo_III Posted November 18, 2012 Share Posted November 18, 2012 Hi Guys Simple question but as I dont tend to work with dates much I figured I'd get some advice. I have a DB table and one of the fields is the 'date of publish' in the format 'YYYY-MM-DD' and based on whether the date is in the future or the past I need to display the row data. What I was wondering is whether a method as simple as the following is a viable method to determine whether the date from the db is in the future or not: strtotime() on date from database Get current time() use the php min function to determine if the date in the database is larger than current time - which would indicate it's in the future. Or is that too simplistic and stupid? The other option I am playing with is DateTime::diff but as I need to evaluate a large number of values in this way it seems a bit heavy. Any opinions on whether i am on the right track, and if so, which you'd advise? Thanks, Drongo Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.