Jump to content

Dates


Muncey

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/62326-dates/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/62326-dates/#findComment-310104
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.