In my getRequest i'm passing two Strings (minTime and maxTime), in MySQL I have two columns TIME (minTime and maxTime) I need all the registers between these two values.
For that reason I need to convert minTime and maxTime to sql.date and retrieve the proper registers (with strings is not working properly). I'm trying many things without success, for example:
String minTime_user = "10:45"
java.util.Date utilDate = new SimpleDateFormat("hh:mm").parse(minTime_user);
//output: Thu Jan 01 10:28:00 GMT-05:00 1970
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
//output: 1970-01-01
If not possible, how can I convert String to Time in PHP? I've seen the function strtotime but it returns the number of seconds since 1970, ideally I prefer the format "hh:mm" to be able to compare without having to convert the values of my table to Unix.