將字串串轉成日期(date + time)的方法
var strDate = "2009-06-22 09:41:30";
var newDate = new Date(Date.parse(strDate .replace(/-/g, "/"))); //利用regular expression 將'-' 代換成 '/'
alert (newDate );
全站熱搜
將字串串轉成日期(date + time)的方法
var strDate = "2009-06-22 09:41:30";
var newDate = new Date(Date.parse(strDate .replace(/-/g, "/"))); //利用regular expression 將'-' 代換成 '/'
alert (newDate );
留言列表