I have a query in which i want to select records for a single day only. like b/w '00:00:00' to '23:59:59'.
for example if user select data and time(2016-06-27 10:40) then my query would be like:
select * from users where logtime between ? and '2016-06-27 23:59:59' // logtime is a timestamp
You can extract a date from a timestamp by simply casting the timestamp to
date. So if I understand you problem correctly, you should something like that:
select * from users where logtime::date='2016-06-27 10:40'::date;
Edit: If you really want to simply extract the date to combine it with a different timestamp you can do it by manipulating the timestamp as a string, eg:
SELECT ('2016-06-27 10:40'::date || ' 23:59:59')::timestamp;