How to use moment.js to get remaining hours, minutes, and seconds from a unix timestamp?
问题 Given a unix timstamp in the future, how can I use Moment.js to get the hours, minutes, and seconds remaining until then? For example: now = 1589252712837 time = 1589356202907 // This is the line I do not know res = moment(time - now) console.log(res) // 23 hours, 12 minutes, 3 seconds Edit: I believe I can do something like this, but is there a native way to do it?: now = 1589252712837 time = 1589356202907 remaining = time - now hour = moment(remaining).hour() minute = moment(remaining)