返回在我的.js文件中,我調用一個c#web服務。如何正確地格式化日期,從web服務c#
function getDetailsFromDb(id_mac, id_instance) {
$.ajax({
type: "POST",
url: "webMethods/GetData.asmx/getServicesById",
dataType: "json",
data: JSON.stringify({
idMacchina: id_mac,
idIstanza: id_instance
}),
contentType: "application/json; charset=utf-8",
success: function (msg) {
var itemsLoaded = msg.d;
},
error: function (err) {
alert(err);
}
});
該函數返回一組對象,我從我的數據庫中獲取。 theese領域之一,返回日期,在followning格式:
/Date(1467878700750)/
現在,我需要從字符串,日,月,年,小時,分鐘,秒和毫秒來獲得。 我怎樣才能得到這些信息?
在此先感謝
相反,如果你想在解析JS該值有用:http://www.hanselman.com/blog/OnTheNightmareThatIsJSONDatesPlusJSONNETAndASPNETWebAPI.aspx –