Question: how to convert string to date in yyyy-mm-dd format javascript?
Answer: As you only need a simple date format (yyyy-MM-dd) , something as easy as the code below should do the job: var date_input = new Date($("#date_input"). val()); var day = date_input. getDay(); var month = date_input.