I am using Date.parse to convert a string to a date in javascript, however, if the string looks like this '10/11/2016' it is interpreted as Oct 11 2016, i need it to be interpreted as Nov 10 2016
Suggestions?
I am using Date.parse to convert a string to a date in javascript, however, if the string looks like this '10/11/2016' it is interpreted as Oct 11 2016, i need it to be interpreted as Nov 10 2016
Suggestions?
By default Date.parse
consider in this format that month precede the day to be in your case MM/DD/YYYY not as you want DD/MM/YYYY.
I prefer/suggest using 3rd party date parser library as Moment.js
It can take your date-string and the format to be like this:
moment("10/11/2016", "DD-MM-YYYY");