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();
精彩评论