javascriptで2つの日付間隔の日数を計算します.
615 ワード
<script>
/*
*/
// : - -
var date1 = "12-3-2013";
var date2 = "6-6-2013";
// 1970 1 1
var time1 = Date.parse(date1);
var time2 = Date.parse(date2);
// ,
var dayCount = (Math.abs(time2 - time1))/1000/60/60/24;
alert(dayCount);
</script>
<div id="time"/>
</code></pre>
<br/>
</div>
</div>
</div>
</div>