How to caluclate the dates differanct?

How to caluclate the dates differanct?

Hi
I am trying to calculate the date differance

here it what i have done

note how is the date format that i am using 20-2-2013

diff variable is displaying "Invalid Date "



  1.         var from =     $('#from').val();  //ex. 20-2-2013
            var to = $('#to').val();    //ex.25-2-2013
           
           
            // end - start returns difference in milliseconds
            var diff = new Date(to - from);
            console.log(diff);
            // get days
            var days = diff/1000/60/60/24;  //ex.5