var time= (new Date("2015/03/30 12:00:00")).getTime(); //得到毫秒數(shù)
//下面格式的時間需要轉(zhuǎn)換:
var time = '2015-03-30 12:00:00';
time = time .replace(new RegExp("-","gm"),"/");
var times = (new Date(time )).getTime(); //得到毫秒數(shù)
//毫秒數(shù)轉(zhuǎn)化為時間
var time = (new Date("2015/03/30 12:00:00")).getTime(); //得到毫秒數(shù)
var newTime = new Date(time ); //就得到普通的時間了
更多信息請查看IT技術(shù)專欄