I'm having a table(in MySQL) in which all dates are stored in the form of UNIX timestamp values. Now what I want to achieve is fetch up only those records from the table whose date will be today's date. How should I achieve this? Is any one have any magic for it? Please help me out to resolve this issue. Thanks in advance.
Asked
Active
Viewed 2,087 times
0
-
please check http://stackoverflow.com/questions/9251561/convert-timestamp-to-date-in-mysql-query – Andron Jul 08 '13 at 08:30
2 Answers
1
you can get it like this.
eg.
ctime BETWEEN UNIX_TIMESTAMP(CURDATE()) and UNIX_TIMESTAMP(DATE_ADD(CURDATE(),INTERVAL 1 day))

xiaolee
- 26
- 1
0
DATE_FORMAT(FROM_UNIXTIME('date_before_format'), '%e %b %Y') AS 'date_formatted'

mirkobrankovic
- 2,389
- 1
- 21
- 24