JavaScript - Date & Time Table of Contents Time Difference - Using Moment.js Time Difference - Using Moment.js // example of difference in seconds const currentTime = moment(); const diff = currentTime.diff(startTime, 'seconds'); Source: https://momentjs.com/docs/#/displaying/difference/