the code is as follows
public static void main(String[] args) {
String text = "2018-11-26-13:50:00";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-hh:mm:ss");
sdf.setLenient(false);
try {
System.out.println(sdf.parse(text));
} catch (ParseException e) {
// java.text.ParseException: Unparseable date: "2018-11-26-13:50:00"
e.printStackTrace();
}
}
setLenient (false), the date midhour is operational from 1 a.m. to 12:00, and an error is reported between 13:00 and 00:00
ask the great god to solve the doubt.