JS calculates the interval between two times (days, hours, minutes, seconds)

function fun () {     let startTime = new Date('2015-12-20'); // start time let endTime = new Date(); // end time let usedTime = endTime - startTime; // difference in milliseconds let days = Math.floor (usedTime / (24 * 3600 * 1000)); // Calculate the number of days let leavel

The post JS Computing the interval between two times (days, hours, minutes, seconds) first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/9180
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment

Your email address will not be published.