【发布时间】:2015-05-18 09:04:22
【问题描述】:
我的 json 输出收到以下响应,在此我必须将 /Date(1419969600000+0400)/ 转换为 本地日期格式,我已经搜索过这个,没有匹配的,有人帮助,在此先感谢...
{
"ErrorCode": 0,
"ErrorMessage": "",
"CustomerDueInvoices": [
{
"Customer_ID": "00000001",
"Details": "Bill for The Month of December 2014",
"DueAmount": 549.31,
"DueDate": "/Date(1419969600000+0400)/",
"InvoiceAmount": 549.31,
"InvoiceDate": "/Date(1419969600000+0400)/",
"InvoiceNo": "RTDBNWP/201527/14",
"Property_Code": "WP-A-E003",
"RevenuHead": "Late Payment Fee -gf"
},
{
"Customer_ID": "00000001",
"Details": "Bill for The Month of December 2014",
"DueAmount": 132.03,
"DueDate": "/Date(1419969600000+0400)/",
"InvoiceAmount": 132.03,
"InvoiceDate": "/Date(1419969600000+0400)/",
"InvoiceNo": "RTDBNWP/201633/14",
"Property_Code": "WP-A-E003",
"RevenuHead": "Late Payment Fee"
}
]
}
【问题讨论】:
-
字符串结果 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new Date(Long.parseLong(date)));
-
@HoangQBH,由于字符导致数字格式异常
-
@arun,使用子字符串删除 5 个字符“+0400”.. 希望对您有所帮助
-
你很好,但是这里需要 +0400
标签: android