How do I convert string(09-Apr-2010) in to date time (09 April 2010 00:00:00) using java script? I need to compare the dates for validation.
check out Date.parse
str = "09-Apr-2010"
date = new Date(Date.parse(str.replace(/-/g, " ")))
alert(date.toLocaleString())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With