Hi i have two dates in UI: To and From, in format dd.MM.YYYY HH:mm:ss I need to find the difference between the two dates in months. I tried the following to get month and year of the date but does not work:
var To = $("#startDate").val();
alert(To.getMonth() + To.getFullYear());
It gives NANANA as alert. P.S it works pretty fine for format YYYY-MM-dd HH:mm:ss but not for the above format