I am getting following exception -
com.google.gson.JsonSyntaxException: 04/03/2017 10:39:55.000
at com.google.gson.DefaultDateTypeAdapter.deserializeToDate(DefaultDateTypeAdapter.java:107)
I have set the date format as -
Gson gson = new GsonBuilder().setDateFormat("MM/dd/yyyy hh:mm:ss a").create();
And I don't have control on the date format. How can I setup GsonBuilder to handle 2 different time formats so that the above exception can be avoided?
EDIT - In another instance the Time will appear as 04/03/2017 10:39:55 AM
That's why I need to handle 2 different time formats.