Question: how to convert yyyy-mm-dd to date in javascript?
Answer: 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 = $("#datepickertwo"). val(); var f = new Date(from); var t = new Date(to);