开发者

Creating an JSON Date a la ASP.NET Format

There's a great thread here: How do I format a Microsoft JSON date? that shows how to parse an ASP.NET formatted JSON date:

/Date(1224043200000)/

... back into an actual JavaScript Date object. However, it doesn't show how to go the other way. So,开发者_Go百科 given a date - how do I go from:

new Date() // to /Date(1224043200000)/ ???


var d = ['/Date(', new Date().getTime(), ')/'].join('');


var t = new Date();
t.getTime();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜