GsonBuilder build = new GsonBuilder();
build.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
@Override
public Date deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
return new Date(jsonElement.getAsJsonPrimitive().getAsLong());
}
});
Gson gson = build.create();
Gson日期问题
最新推荐文章于 2023-11-15 22:21:56 发布
1776

被折叠的 条评论
为什么被折叠?



