我想将日期格式化为mm/dd/yyyy.我尝试了以下内容,但没有一个适合我.谁能帮我这个?
参考:ui-date
<input ui-date ui-date-format="mm/dd/yyyy" ng-model="valueofdate" />
<input type="date" ng-model="valueofdate" />
Run Code Online (Sandbox Code Playgroud) 我有以下代码
var c = new Date(Date.parse("2011-06-21T14:27:28.593Z"));
console.log(c);
Run Code Online (Sandbox Code Playgroud)
在Chrome上,它会在控制台上正确打印出日期.在Safari中它失败了.谁是正确的,更重要的是处理这个问题的最佳方法是什么?
date ×2
angularjs ×1
date-format ×1
datefilter ×1
format ×1
javascript ×1
parsing ×1
safari ×1