首页 > 其他 > 详细

The specified value "2019-1-2" does not conform to the required format, "yyyy-MM-dd"

时间:2019-01-02 11:33:50      阅读:1531      评论:0      收藏:0      [点我收藏+]

问题:

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

 

The specified value "2019-1-2" does not conform to the required format, "yyyy-MM-dd"

原文:https://www.cnblogs.com/gangler/p/10207339.html

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