var oDate=new Date();//獲取時間Thu Jan 12 2017 14:39:16 GMT+0800 (中國標準時間)
var iM=oDate.getTime();//得到毫秒數1484203184804
var nDate=new Date(1484203184804);//直接將毫秒數當參數傳進去。Thu Jan 12 2017 14:40:01 GMT+0800 (中國標準時間)
var dt=new Date( ?);
var a= (dt.getFullYear() +'-'+ (dt.getMonth() +1) +'-'+dt.getDate() +' '+dt.getHours() +':'+dt.getMinutes() +':'+dt.getSeconds()).replace(/([\-\: ])(\d{1})(?!\d)/g,'$10$2');
console.log(a); ?//2017-01-13 08:42:16
var oDate=new Date();
var a = (oDate.getFullYear() + '年' + (oDate.getMonth() + 1) + '月' + oDate.getDate()+"日")
console.log(a) ?//2017年3月8日
var d=new Date();
d.toUTCString();//把本地時間轉換為標準時間