MVC5中返回json时间
定义一个基控制器
public class BaseController : Controller { // GET: admin/Base protected ContentResult JsonDate(object Data) { var timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" }; return Content(JsonConvert.SerializeObject(Data, Formatting.Indented, timeConverter)); } }
返回的时候使用JsonDate
浙公网安备 33010602011771号