标签: c# javascript json serialization
如何将日期格式/Date(1302589032000+0400)/转换为JS Date对象?
/Date(1302589032000+0400)/
答案 0 :(得分:18)
首先删除文字:
var src = "/Date(1302589032000+0400)/"; //Remove all non-numeric (except the plus) src = src.replace(/[^0-9 +]/g, ''); //Create date var myDate = new Date(parseInt(src));
Here's a workding jsFiddle