「JavaScript入門」時間の差を計算するコード
JSコード
var endDate = new Date('2017/03/16’);
var startDate = new Date('2017/03/15’);
var timeDiff = (endDate.getTime() – startDate.getTime()) / (1000 * 60 * 60);
console.log('時間の差:’ +timeDiff );
Coding Changes the World
JSコード
var endDate = new Date('2017/03/16’);
var startDate = new Date('2017/03/15’);
var timeDiff = (endDate.getTime() – startDate.getTime()) / (1000 * 60 * 60);
console.log('時間の差:’ +timeDiff );