mysql - get current date with PHP help -


Is there a script to check the current date in PHP?

I want to use this function to display a date from Mysql DB, and if the date from DB is similar to today's date, then display "TODAY" instead ...

Thank you ...

To obtain the current timestamp (second from 1970) Use time ()

You want to convert it to any format,

To compare, there are several ways that you do Can But I think it would be simple:

$ DateFromDB = getTheDateFromMyDB (); // "2009-10-20" $ Today = Date ("Y-M-D"); If ($ Today == $ dateFromDB) {// ...}

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -