返回在我的.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 –