Hi in my PostgreSQL
in using time without time zone to save a specific time (19:36:17.376)
, and in my web application in using jQuery date picket for picking a time from client side for search by time in the format(12:30 PM)
.
How to convert the time 12:30 PM
to this format(19:36:17.376)
.
i am using hibernate for searching. searching java code
String queryString = "from TicketBooking t where t.isSale='true' "; queryString = queryString
+ " and t.time BETWEEN :stTime AND :edTime"; SimpleDateFormat displayFormat = new SimpleDateFormat("HH:mm");
SimpleDateFormat parseFormat = new SimpleDateFormat("yyy-mm-dd hh:mm a");
Date date1 = parseFormat.parse(fromTime);
Date date2 = parseFormat.parse(toTime);
System.out.println( displayFormat.format(date1)+"------------------"+displayFormat.format(date2));
query.setParameter("stTime", displayFormat.format(date1)); query.setParameter("edTime", displayFormat.format(date2));