How To Convert String ' dd/mm/yy hh:MM:ss ' to Date in javascript?

If you are looking for alternatives in jquery or Javascript , then you can go with Moment.js,where you can Parse, Validate, Manipulate, and Display dates in JavaScript.

example:

  var date= moment("06/06/2015 11:11:11").format('DD-MMM-YYYY');

How about Date.parse()?

new Date( Date.parse("05/12/05 11:11:11") );
// Thu May 12 2005 11:11:11 GMT+0200 (CEST)

The output produced is in local timezone and will differ in browsers in different timezones.


We can convert any local date format to datetime datatype using moment js.

Syntax:

moment('<local date value>','<local date format>').format('<expected convert format>')

Example:

moment('26/05/1986 00:00', 'DD/MM/YYYY HH:mm').format("MM/DD/YYYY HH:mm");

then the output will be 05/26/1986 00:00

Cheers