Date.parseWeird = Date.prototype.parseWeird = function (d) {
return new Date(parseInt(d.replace(/[^\-\d]/g, ""), 10));
};
var newDate = Date.parseWeird("\/Date(1317847200000-0400)\/");
document.write(newDate);
這將返回我提取時間Thu Oct 06 2011 02:10:00 GMT+0530 (India Standard Time)
之日起輸入反應
我想提取這個02:10:00
,並轉換到這個時候像這樣9:30 P.M or A.M
哪裏日期從何而來?它看起來像來自服務器上.NET webmethod的默認日期,我是對的嗎?你可以解決問題的服務器端然後(看看JSON序列化) –
@Baszz:我沒有訪問服務器端...我必須在客戶端.. –