JYL
JYL

Reputation: 8319

Same date but different days with momentjs?

Why does this code give 2 different days :

var m1 = moment("2103-12-18T10:11:00");
var m2 = moment("2013-12-18T15:07:00");
document.write(m1.format('dddd DD/MM/YYYY [at] HH[:]mm'));
document.write("<br/>");
document.write(m2.format('dddd DD/MM/YYYY [at] HH[:]mm'));

Output :

Tuesday 18/12/2103 at 10:11 
Wednesday 18/12/2013 at 15:07

In fact Tuesday should be Wednesday... My timezone is UTC+1, so it shouldn't be a timezone problem. Is this a bug ?

Upvotes: 2

Views: 92

Answers (1)

gtgaxiola
gtgaxiola

Reputation: 9331

Layer 8 error I think:

var m1 = moment("2103-12-18T10:11:00");
var m2 = moment("2013-12-18T15:07:00");

m1 is in the year 2103

m2 is in the year 2013

Upvotes: 3

Related Questions