利用 fastjson 的 toJSONStringWithDateFormat 方法,将Date 格式化 为常见类型的时间


利用 fastjson 的 toJSONStringWithDateFormat 方法,将Date 格式化 为常见类型的时间

JSON.toJSONStringWithDateFormat(nrcStoryWrapper, "yyyy-MM-dd'T'HH:mm:ss.SSSZ", SerializerFeature.WriteDateUseDateFormat)

 

 将json中的publishTime 转成 yyyy-MM-dd HH:mm:ss 格式

new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(jsonStory.getString("publishTime"))


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM