java - Can't retrieve correct time from database -


i have fields starttime , endtime in table type time. when try retrieve query gives wrong values of time if data table values correct. query follows :

select     ts.id,     ts.serviceruleid,     from_unixtime(ts.starttime, '%h %i %p') tempstrttime,     from_unixtime(ts.endtime, '%h %i %p') tempendtime,     ts.createdby,     ts.createdon,     ts.startdate,     ts.enddate     temporarytimeslots ts group     ts.id 

why using from_unixtime etc.

you using java, use sql.date object , correct result

select ts.id, ts.serviceruleid,ts.starttime tempstrttime, ts.endtime tempendtime, ts.createdby, ts.createdon, ts.startdate, ts.enddate temporarytimeslots ts group ts.id  

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -