假设我有两个名为AdmittedDate
和currentDate
的变量。它们包含像
"2014-10-13 14:47:44.0"
我想将它们转换为日期并减去它们并在网页中显示它们。有人可以帮忙吗?
答案 0 :(得分:0)
<强>的JavaScript 强>
var differenceInMin=(new Date(AdmittedDate ).getMilliseconds()-new Date(currentDate).getMilliseconds())/60000;
var diffInHrs=differenceInMin/60;
var diffInDays=parseInt(diffInHrs/24)+" "+parseInt(diffInHrs)+":"+((diffInHrs-parseInt(diffInHrs))*60);