I am using this method to parse a String to SQL Time in Java. However, it does not work relly good due to the fact it return a date with a negative value when I input "12:00".
Here is the method:
public static Time isoStringToTime(String isoTimeString) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("hh:mm", new Locale("es", "ES"));
return new Time(sdf.parse(isoTimeString).getTime());
} catch (ParseException e) {
throw new ApplicationException("Formato ISO incorrecto para fecha: " + isoTimeString);
}
}
The new Time returned introducing "12:00" has a negative value, -3600000 is the value.