Hi mysql unix timestamp are stored in date column of my table now i am searching from date picker with two fields i.e. from_date and to_date but I did not found any records tried a lot of ways but not succeeded my date picker date is like this 08/22/2017 while unix timestamps stored in table are like
1503380449
1503380428
1503380326
how can i fire mysql query to get records between two dates I tried mysql UNIX timestamp functions but not working.
I tried this :-
SELECT * FROM tbl_example WHERE
my_date BETWEEN
STR_TO_DATE('2017/08/22', '%Y %D %M %h:%i:%s %x')
AND
STR_TO_DATE('2017/08/22', '%Y %D %M %h:%i:%s %x')
I tried this:-
SELECT * FROM tbl_example WHERE
my_date BETWEEN
UNIX_TIMESTAMP(STR_TO_DATE('2017/08/22', '%M %d %Y %h:%i%p')
AND
UNIX_TIMESTAMP(STR_TO_DATE('2017/08/22', '%M %d %Y %h:%i%p')
I also tried this:-
SELECT * FROM tbl_example WHERE
my_date BETWEEN
FROM_UNIXTIME(UNIX_TIMESTAMP(STR_TO_DATE('Aug 22 2017 12:00AM', '%M %d %Y %h:%i%p')))
AND
FROM_UNIXTIME(UNIX_TIMESTAMP(STR_TO_DATE('Aug 22 2017 12:00AM', '%M %d %Y %h:%i%p')))
thanks