Muncey Posted July 29, 2007 Share Posted July 29, 2007 Well i made it so when somebody clicks a certain button it logs the date in a database then it pulls it out when needed and matches it to todays date and if it matches it displays Today, instead of the date. Im trying to do the same thing but for Yesterday, so i need to match the date in the database to the date of yesterday. How do i find the date then take away a day? Im using date('F d, Y'); btw... i need to take a day away but im not sure how. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 29, 2007 Share Posted July 29, 2007 I would strongly recommend storing the date in the database in ISO format, i.e. yyyy-mm-dd. That will allow you all sorts of flexibility in processing your database and - of course - you can display the date in whatever format you choose. http://www.php.net/manual/en/function.strtotime.php might be useful to you. Quote Link to comment Share on other sites More sharing options...
Muncey Posted July 29, 2007 Author Share Posted July 29, 2007 Im confused, what do i store the date as? Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 29, 2007 Share Posted July 29, 2007 Im confused, what do i store the date as? date. It's that simple. Quote Link to comment 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.