全局配置
在Startup文件中修改
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddMvc() //全局配置Json序列化处理 .AddJsonOptions(options => { //设置时间格式 options.SerializerSettings.DateFormatString = "yyyy-MM-dd"; } ); }
如果对你有用,请点赞支持,你的支持,是我不断分享的动力。