Convert a date in string form to a Date object
var strtime= "2011-04-16"; String date format
var date= new Date (Date.parse (Strtime.replace (/-/g, "/")));//Convert to data ();
var month=date.getmonth () +1; Get Current Month
------------------------------------------------------------------------------------------------------
Date.getyear ();Get Current year (2-bit)
Date.getfullyear ();Get the full year (4-bit, 1970-????)
Date.getmonth ();Get the current month (0-11, 0 for January)
Date.getdate ();Get current day (1-31)
Date.getday ();Get Current week x (0-6, 0 for Sunday)
Date.gettime ();Gets the current time (the number of milliseconds since 1970.1.1)
Date.gethours (); //Get current hours (0-23)
Date.getminutes (); //Gets the current number of minutes (0-59)
Date.getseconds (); //Gets the current number of seconds (0-59)
Date.getmilliseconds (); //Gets the current number of milliseconds (0-999)
Date.tolocaledatestring (); //Get the current date
var mytime=date.tolocaletimestring (); //Get current time
Date.tolocalestring (); //Get date and time
JS converts a string into a date type