开发者

Parse JSON date with GSON

开发者 https://www.devze.com 2023-03-30 14:54 出处:网络
How can I parse JSON dates with GSON? Ke开发者_如何学运维eps getting errors. The date format in the JSON looks like this:

How can I parse JSON dates with GSON? Ke开发者_如何学运维eps getting errors.

The date format in the JSON looks like this:

/Date(1313613992133+0200)\

Any advice would be appreciated!


Try using

new Date(Long.parseLong("1313613992133")).toGMTString()


You can use:

    Date date = new Date(Integer.parseInt(jsonDateString.substr(6)));

Similar question answered here: How do I format a Microsoft JSON date?

0

精彩评论

暂无评论...
验证码 换一张
取 消