I have a json as
{"redemptionStartDate":1436950251941,"redemptionEndDate":1500108651941}
and I am trying to parse this json into an object which has date objects(java.util.Date) as
private Date redemptionStartDate;
private Date redemptionEndDate;
I am getting error as com.google.gson.JsonSyntaxException while parsing into those Date objects. How can I resolve this issue?
Method to parse json
public static <T> T fromJson(String json, Class<T> classOfT) {
Gson gson = new Gson();
T obj = gson.fromJson(json, classOfT);
return obj;
}