Dates

Now + 10 mins

const newDate = new Date(Date.now() + 10 * 60 * 1000);

UTC

new Date('milisecs').toLocaleString() // 26/04/2023, 15:59:53
new Date('milisecs').toUTCString(); // Wed, 26 Apr 2023 20:59:53 GMT
new Date('milisecs').toISOString() // 2023-04-26T20:59:53.661Z

// moment
const utcMoment = moment.utc('milisecs').format(); // 2023-04-27T12:47:00Z

Time diff

moment.duration(expTime.diff(moment())).asSeconds()

Last updated

Was this helpful?