How to convert a "DD-MMM-YYYY" string to a date in Jquery?
I've a date in string "14-Jun-2014". I want to convert it to a date; something like this 14-06-2014
. For $("#InvoiceToDate").text();
I get this "14-Jun-2014"
So for
new Date($("#InvoiceToDate").text())
But its showing
Sat Jun 14 2014 00:00:00 GMT+0600 (Bangladesh Standard Time)
I've also tried this
new Date($("#InvoiceToDate").text()).toLocaleString('en-GB');
Now its showing almost what I wanted.
"06/08/2014 00:00:00"
How can I get only dd/MM/yyyy. Please help.