问题:

在cshtml中转换的日期格式错误,前端报错:The specified value "2019-1-2" does not conform to the required format, "yyyy-MM-dd"

 

导致原因:

由于时间格式没有完全匹配,"yyyy-MM-dd"应该对应"2019-01-02"

 

修改代码:

string.Format("{0:yyyy-MM-dd}", DateTime.Now);

 

相关文章:

  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2021-12-28
  • 2021-05-22
  • 2021-08-25
猜你喜欢
  • 2022-12-23
  • 2021-08-10
  • 2021-07-28
  • 2022-03-03
  • 2022-12-23
  • 2022-01-19
  • 2022-03-03
相关资源
相似解决方案