0

I have changed the date field I am using in one of my sites. The new field appears to store the dates in UNIX time format.

I was using this:

AND matrix.col_id_3 > (DATE_FORMAT(NOW(), '%Y%m%d'))

to check if the date stored in matrix.col_id_3 was more than todays date.

How can I do this with the UNIX time format?

The dates look like this: 1412736180

2 Answers2

2

Try

DATE_FORMAT(FROM_UNIXTIME(matrix.col_id_r),'%Y%m%d') > DATE_FORMAT(NOW(),'%Y%m%d');
Abdul Manaf
  • 4,768
  • 3
  • 27
  • 34
0

Try AND matrix.col_id_r > NOW() or AND DATE_FORMAT(matrix.col_id_3, '%Y%m%d') > DATE_FORMAT(NOW(), '%Y%m%d')

beniamin
  • 81
  • 3