Compare Two Different Date

SELECT * FROM `events` 
TO_SECONDS(`start_time`) >= TO_SECONDS('2012-10-27')
and TO_SECONDS(`start_time`) < TO_SECONDS('2013-2-1')

TO_SECONDS function is available after mysql 5.5

UNIX_TIMESTAMP('2012-12-21') could be a replacement

One thought on “Compare Two Different Date

  1. I need to to thank you for this very good read!! I certainly
    loved every bit of it. I have you book marked to look at new stuff
    you post…

Comments are closed.