JsonConfig config = new JsonConfig(); config.registerJsonValueProcessor(Date.class, new DateJsonValueProcessor("yyyy-MM-dd hh:mm")); dataMessage = JSONObject.fromObject(user, config);
json集合中转换时间Date格式
最新推荐文章于 2025-07-14 16:22:09 发布
JsonConfig config = new JsonConfig(); config.registerJsonValueProcessor(Date.class, new DateJsonValueProcessor("yyyy-MM-dd hh:mm")); dataMessage = JSONObject.fromObject(user, config);