1

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?

1
  • FROM_UNIXTIME() converts to a datetime Commented Mar 28, 2015 at 10:14

2 Answers 2

1

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();
Sign up to request clarification or add additional context in comments.

Comments

0
WHERE DATE(FROM_UNIXTIME(Signup)) = curdate()

3 Comments

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.
It answers the question with the solution.
As a very high rep user please don't fill up the low quality review queue with a code dump only answer. We have enough of them from the newcomers. This answer was flagged as low-quality because of its length and content.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.