php - MysQL Get Time via Query -


the time in row 'signup' stored this: "1427538785" not able use method: where date(signup) = date(now())

but need query time of signup today..

any idea how solve this?

you need from_unixtime

mysql> select from_unixtime('1427538785','%y-%m-%d'); +----------------------------------------+ | from_unixtime('1427538785','%y-%m-%d') | +----------------------------------------+ | 2015-03-28                             | +----------------------------------------+ 1 row in set (0.00 sec) 

so query

where from_unixtime(signup,'%y-%m-%d') = curdate(); 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -