Reputation: 107
The time in row 'Signup' is stored like this: "1427538785"
So I am not able to use this method: WHERE DATE(Signup) = DATE(NOW())
But need to get the query where time of signup is today..
Any Idea how to solve this?
Upvotes: 1
Views: 45
Reputation: 44874
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 the query will be
WHERE from_unixtime(Signup,'%Y-%m-%d') = curdate();
Upvotes: 1