Back
I have this string 30/11/2011. I want to convert it to a date object.
Do I have to use:
Date d = new Date(2011,11,30);
Or
Date d = new Date(2011,10,30);
You have to use
var d = new Date(2011,10,30);
As months are indexed from 0 in JavaScript.
Want to learn full stack development? Check out the full-stack developer course from Intellipaat.
31k questions
32.8k answers
501 comments
693 users