我正在尝试本地化我的日期,但我收到了 NAN 无效日期。会是什么错误?
function localizeUTCDateTime(date) {
var utcdate = new Date(date + " UTC");
return utcdate.toDateString() + " " + utcdate.getHours() + ":" + utcdate.getMinutes() + ":" + utcdate.getSeconds();
}
var creationDate = '2014-09-23T00:59:26.92';
$('#divTime').text(localizeUTCDateTime(creationDate));
<div id='divTime'>
</div>