第一种办法:前端JS转换: //格式化显示json日期格式 function showDate(jsonDate) { var date = new Date(jsonDate); var formatDate = date.toDateString(); return formatDate; } 第二种办法: var converters = Configuration.Modules.AbpWebApi().HttpConfiguration.Formatters.JsonFormatter…
.netcore3.0 的json格式化不再默认使用Newtonsoft.Json,而是使用自带的System.Text.Json来处理. 理由是System.Text.Json 依赖更少,效率更高. webapi定义的参数如果是个datetime类型的话 比如 public class Input { public DateTime?Begin{get;set;} public DateTime?End{get;set;} } webapi的controller中定义的action publi…
function jsonDateFormat(jsonDate) {//json日期格式转换为正常格式 try { var date = new Date(parseInt(jsonDate.replace("/Date(", "").replace(")/", ""), 10)); var month = date.getMonth() + 1 < 10 ? "0" + (date.getMont…