【发布时间】:2015-08-19 13:33:29
【问题描述】:
我有一个带有created Date 属性的联系人类。我正在尝试执行以下操作:
Contact received = gson.fromJson(contactJson, Contact.class);
但是我得到了例外:
com.google.gson.JsonSyntaxException: 1433444958703
at com.google.gson.internal.bind.DateTypeAdapter.deserializeToDate(DateTypeAdapter.java:81)
at com.google.gson.internal.bind.DateTypeAdapter.read(DateTypeAdapter.java:66)
已经发布了与此类似的解决方案: "Unparseable date: 1302828677828" trying to deserialize with Gson a millisecond-format date received from server
但是它对我不起作用(不会编译)。
Gson 2.3.1 版
想法?
TIA, - 奥莱
【问题讨论】: