I have the following method:
public static Date convertFromWowInterface(String wowinterfaceFormat){
Date date = null;
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yy hh:mm a");
date = dateFormat.parse(wowinterfaceFormat);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
The string being passed in is of the format:
"08-11-19 07:00 AM"
without the quotes obviously. Now the above method works just fine on my mac, however when some of my users use the program (on Windows) they get the exception:
java.text.ParseException: Unparseable date: "08-11-19 07:00 AM"
at java.base/java.text.DateFormat.parse(DateFormat.java:395)
Does the OS make a difference here? Or is there something else at play? As far as I can tell the SimpleDateFormat match the input string exactly?