current position:Home>JavaScript calculates the number of days, hours, minutes and seconds between days

JavaScript calculates the number of days, hours, minutes and seconds between days

2022-05-15 02:05:40thankseveryday

//  Seconds from start date to present 
let second = parseInt(new Date().getTime() / 1000) - parseInt(new Date('2021-08-4').getTime() / 1000)
//  return int 
let day = parseInt(second / 60 / 60 / 24); 
//  The difference is hours 
let hour = parseInt(second / 60 / 60); 
//  Minutes difference 
let minutes = parseInt(second / 60); 

copyright notice
author[thankseveryday],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/132/202205120527259353.html

Random recommended