// set up let start = moment("2018-05-16 12:00:00"); // some random moment in time (in ms) let end = moment("2018-05-16 12:22:00"); // some random moment after start (in ms) let diff = end.diff(start); // execution let f = moment.utc(diff).format("HH:mm:ss.SSS"); alert(f);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter