0

Using PHP time() function, I have got this timestamp - 1407760251 (11-08-2014)

Also using only YY-MM-DD (date picker) I have generated this timestamp - 1407708000 (11-08-2014)

MySQL table has time() timestamp, I want to filter same day records from MYSQL table how to do it? please help me.. thank you

Gayan
  • 2,845
  • 7
  • 33
  • 60

1 Answers1

1

Use date for the PHP side:

date("d-m-Y", $millis);

and use DATE on the MySQL side to make a timestamp comparable to the date you have:

SELECT someFields
FROM MyTable
WHERE DATE(myDate) = date("d-m-Y", $millis)
Ende Neu
  • 15,581
  • 5
  • 57
  • 68