I have a \'time remaining\' counter in place for file uploads. The remaining duration is calculated and converted into milliseconds like so:
var elapsedTime
I ended up being happy with date-fns' formatDistanceToNow. You can add that function without having to add the whole library like moment.js