Using momentjs:
The following two variables have the same value:-
console.log(moment().format('X'))
console.log(moment.utc().format('X'))
Using Date() built-in:
console.log(new Date().getTime()) // including fractional seconds
console.log(Math.floor(new Date().getTime()/1000)) // up to seconds