JS 将字符串转换成日期类型
(2011-10-20 16:46:58)将字符串形式的日期转换成日期对象
var strTime="2011-04-16"; //字符串日期格式
var date= new Date(Date.parse(strTime.replace(/-/g,
var month=date.getMonth()+1; //获取当前月份
------------------------------------------------------------------------------------------------------
date.getYear();
date.getFullYear();
date.getMonth();
date.getDate();
date.getDay();
date.getTime();
date.getHours();
date.getMinutes();
date.getSeconds();
date.getMilliseconds();
date.toLocaleDateString();
var mytime=date.toLocaleTimeString();
date.toLocaleString( );