How to find difference between time in moment.js in React Native
问题 How can I find difference time in React Native (I'm using moment): Like: let end = endTime; // 10:10:05 let start = startTime; // 10:10:03 moment.utc(moment(end," hh:mm:ss").diff(moment(start," hh:mm:ss"))).format("mm:ss") //expected output: 00:00:02 回答1: You would need to use moment.duration function timeRemaining (start, end) { // get unix seconds const began = moment(start).unix(); const stopped = moment(end).unix(); // find difference between unix seconds const difference = stopped -