ParseException when parsing time
Came across this when trying to parse a time. DateFormat timeFormat = DateFormat.getTimeInstance(); timeFormat.parse(“11:23:00”): Caused by: java.text.ParseException: Unparseable date: “11:23:00” at java.text.DateFormat.parse(DateFormat.java:347) Solution was a simple one. Set the style and locale on the DateFormat DateFormat timeFormat = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.UK); timeFormat.parse(“11:23:00”):
Read More »