I have events stored in the MySQL datebase with start date and time stored in column 'startTimeStamp' in UNIX format.
When I try to get events for particular date using simple query
SELECT * FROM events
WHERE FROM_UNIXTIME(startTimeStamp
, '%Y-%m-%d') = '2013-08-20'
everything works fine when date and time under timestamp is bigger then 2AM (i.e. 2013-08-20 03:00:00) but when it's earlier it's not displaying in same day.
Quick example: I have two events - same date but different time
- 2013-08-20 03:00:00 (1376960400)
- 2013-08-20 00:00:00 (1376949600)
I will get the first one when I run query mentioned before, but not the second one. To get the second one I have to query for events from day earlier (2013-08-19)
Do you have any idea why? Maybe I'm missing something?
Thanks a lot!