ASP.NET Core 返回 Json 格式的时候,如果返回数据中有DateTime类型,如何自定义其格式呢?配置如下:

services.AddMvc().AddJsonOptions(opt =>
{
    opt.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm";
});

参考资料:

相关文章:

  • 2021-09-03
  • 2022-12-23
  • 2022-01-28
  • 2021-12-26
  • 2021-11-22
  • 2022-02-12
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2022-01-31
相关资源
相似解决方案