Sudhir Sudhir - 2 months ago 5
AngularJS Question

invalid date format in javascript

I am getting invalid date for one date and other date is working fine, what is the problem in this.

var checkinStartDate=new Date("10/07/2016 09:10:04 AM")
working fine

var checkinEndDate = new Date("10/07/2016 19:10:04 PM")
getting invalid date

Answer

It should be like:

var checkinEndDate = new Date("10/07/2016 07:10:04 PM")

19:10:04 PM There are no AM/PM in 24 hr time format

Comments