function Dateparse (dstr) { //var dstr = ' 2016-1-26 0:7:14 '; var d = dstr.split (') [0].split ('-'); var t = dstr.split (') [1].split (': '); var date = new date (d[0],d[1]-1,d[2],t[0],t[1],t[2]); return date; }
API Documentation Notes:
dateObj = new Date(year, month, date[, hours[, minutes[, seconds[,ms]]]])
Year
Required option. The full year, for example, 1976 (instead of 76).
Month
Required option. Represents the month, which is an integer from 0 to 11 (January to December).
Date
Required option. Represents a date, which is an integer from 1 to 31.
Hours
Options are available. If minutes is provided, it must be given. Represents the hour, which is an integer from 0 to 23 (midnight to 11pm).
Minutes
Options are available. If seconds is provided, it must be given. Represents the minute, which is an integer from 0 to 59.
Seconds
Options are available. If milliseconds is provided, it must be given. Represents the second, which is an integer from 0 to 59.
Ms
Options are available. Represents milliseconds, which is an integer from 0 to 999.
JS Date String Parse