Home > Q&A > body text
P粉2391642342023-08-23 00:28:13
Suppose you have two Date objects, you can simply subtract them to get the difference in milliseconds:
Date
var difference = date2 - date1;
From there, you can use simple arithmetic operations to derive other values.