I am currently trying to convert a dd/mm/yyyy string to a date so i can compare it to another date.
The string, for example, is 16/12/2015 but when i use the below code to convert it to a date it just gives random months / years for example 19/11/1902.
Here is the code:
date = (date.substring(0, 6) + year);
var dsplit = date.split("/");
var myDate=new Date(dsplit[0],dsplit[1]-1,dsplit[2]);
in that above code dssplit[0] is 16, next one is 12 and the last one is 2015 - im not sure why it is doing this.