首页 > Windows开发 > 详细

asp.net core webapi 日期返回中出现字母T

时间:2017-09-07 18:59:14      阅读:726      评论:0      收藏:0      [点我收藏+]

全局配置

在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";
        }
        );
}

  参考链接:http://www.cnblogs.com/tianma3798/p/6918548.html

asp.net core webapi 日期返回中出现字母T

原文:http://www.cnblogs.com/zinan/p/7491175.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!