ORMLite TimeStamp returning Date 2017-01-06 12:50:06.0 want to remove .0 from end

67 Views Asked by At

I am trying to return the date from ORM lite query builder using Timestamp but it is returning -> 2017-01-06 12:50:06.0 (I WANT TO REMOVE .0 FROM THE END)

getReportBy(String fromDate, String toDate, List<Long> applicationIds) throws SQLException{
    return dao().queryBuilder().orderBy(CREATED_AT, false).where()
       .between(CREATED_AT, Timestamp.valueOf(fromDate + " 00:00:01"),
               Timestamp.valueOf(toDate + " 23:59:59"))
       .and().in(APPLICATION_ID, applicationIds)
       .and().ne("status","REGENERATE_OTP").query();

THANKS

1

There are 1 best solutions below

0
On

Just Added a simple String manipulation method and solved the problem ... Thanks all

Here is the small code patch

report.setCreatedAt(report.getCreatedAt().replace(".0",""));