mvc全局时间输出格式化处理
Global文件中:
var formatters = GlobalConfiguration.Configuration.Formatters; var jsonFormatter = formatters.JsonFormatter; var settings = jsonFormatter.SerializerSettings; settings.Formatting = Newtonsoft.Json.Formatting.Indented; settings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; settings.ContractResolver = new CamelCasePropertyNamesContractResolver();