I am using - new Date(2014, 5, 2). But it is not showing the proper date.
When i do console.log(new Date(2014, 5, 2)); on the console it returns - Mon Jun 02 2014 00:00:00 GMT+0530 (India Standard Time). Why June? Should not it be May?
I am using - new Date(2014, 5, 2). But it is not showing the proper date.
When i do console.log(new Date(2014, 5, 2)); on the console it returns - Mon Jun 02 2014 00:00:00 GMT+0530 (India Standard Time). Why June? Should not it be May?
No June is correct, May was last month. Check out w3schools example of the format you're trying to use: http://www.w3schools.com/js/js_dates.asp