i am trying to convert a string in the format dd-mm-yyyy into a date object in JavaScript using the following:
var from = $(\"#datepicker\").val(); var to
You can also write a date inside the parentheses of the Date() object, like these:
Date()
new Date("Month dd, yyyy hh:mm:ss") new Date("Month dd, yyyy") new Date(yyyy,mm,dd,hh,mm,ss) new Date(yyyy,mm,dd) new Date(milliseconds)