moment.js - UTC no funciona como lo espero
Pruebas en la consola del nodo:
var moment = require('moment');
// create a new Date-Object
var now = new Date(2013, 02, 28, 11, 11, 11);
// create the native timestamp
var native = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds());
// create the timestamp with moment
var withMoment = moment.utc(now).valueOf()
// it doesnt matter if i use moment(now).utc().valueOf() or moment().utc(now).valueOf()
// native: 1364469071000
// withMoment: 1364465471000
native === withMoment // false!?!?!
// this returns true!!!
withMoment === now.getTime()
¿Por qué no es nativo el mismo sello de tiempo que con Moment? ¿Por qué withMoment devuelve la marca de tiempo calculada a partir de la hora local actual? ¿Cómo puedo lograr que moment.utc () devuelva lo mismo que Date.UTC ()?