使用 json-lib 解析日期
我有以下 JSON 对象:
{“startDate”:“30/01/2008”,“startPeriod”:“2008”,“dboid”:“5308204301485575800000”,“action”:“更新”,“gri d":"variantAssigGrid","endDate":"30/01/2011","endPeriod":"2011","机构":"5301004301485575300000"}
应用 JSONObject.toBean 后,开始日期和结束日期将设置为结果 bean 中的当前系统日期(而不是 json 字符串中的值)。看起来它们是用 new Date() 初始化的。
有没有办法指定日期格式?我研究了 JsonConfig 类,但没有取得太大成功。
提前致谢!
I have the following JSON object:
{"startDate":"30/01/2008","startPeriod":"2008","dboid":"5308204301485575800000","action":"update","grid":"variantAssigGrid","endDate":"30/01/2011","endPeriod":"2011","institution":"5301004301485575300000"}
After applying JSONObject.toBean, start and end date are set to the current system date in the resulting bean (instead of the values in the json string). It looks like they are initialized with new Date().
Is there any way of specifying the date format ? I looked into JsonConfig class without much success.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
注册您自己的处理器...
Register your own processor...