Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
30 lines
861 B
Plaintext
30 lines
861 B
Plaintext
"use strict";
|
|
exports.differenceInMilliseconds = differenceInMilliseconds;
|
|
var _index = require("./toDate.cjs");
|
|
|
|
/**
|
|
* @name differenceInMilliseconds
|
|
* @category Millisecond Helpers
|
|
* @summary Get the number of milliseconds between the given dates.
|
|
*
|
|
* @description
|
|
* Get the number of milliseconds between the given dates.
|
|
*
|
|
* @param laterDate - The later date
|
|
* @param earlierDate - The earlier date
|
|
*
|
|
* @returns The number of milliseconds
|
|
*
|
|
* @example
|
|
* // How many milliseconds are between
|
|
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
|
* const result = differenceInMilliseconds(
|
|
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
|
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
|
* )
|
|
* //=> 1100
|
|
*/
|
|
function differenceInMilliseconds(laterDate, earlierDate) {
|
|
return +(0, _index.toDate)(laterDate) - +(0, _index.toDate)(earlierDate);
|
|
}
|