开发者

Creating an JSON Date a la ASP.NET Format

开发者 https://www.devze.com 2023-04-09 05:36 出处:网络
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:

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

精彩评论

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