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

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -