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
Post a Comment