I get a Unparseable date when trying to parse a Date string that is sent to my android client.
This is the exception:
java.text.ParseException: Unparseable date: "2018-09-18T00:00:00Z" (at offset 19) at java.text.DateFormat.parse(DateFormat.java:571)
The date format my C# based backend sends (The C# object Property is DateTime):
2018-09-18T00:00:00Z
My Java Code where it fails:
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss aa");
String targetDate = "2018-09-18T00:00:00Z";
Date date = dateFormat.parse(targetDate));
How can I change my code to parse the exact format sent by the backend?