Why is this returning an invalid date with js moment

it

moment(1420066800000);

      

returns an object with an invalid date, why?

EDIT :

moment(1420066800000).isValid() 

      

returns true! But: the property of the moment

_d.__proto__ 

      

- object "Invalid date". This confused me as I thought it was causing misbehavior in my application.

+3


source to share


1 answer


What happened to Wed 31 Dec 2014 23:00:00 GMT + 0000 (UTC)?



> d = moment(1420066800000);
{ _isAMomentObject: true,
  _i: 1420066800000,
  _f: undefined,
  _l: undefined,
  _strict: undefined,
  _isUTC: false,
  _pf: 
  { empty: false,
    unusedTokens: [],
    unusedInput: [],
    overflow: -2,
    charsLeftOver: 0,
    nullInput: false,
    invalidMonth: null,
    invalidFormat: false,
    userInvalidated: false,
    iso: false },
  _d: Wed Dec 31 2014 23:00:00 GMT+0000 (UTC) }

      

-1


source







All Articles