默认时间为今天

//默认登记时间为今天
var date = new Date;
var year = date.getFullYear();
var month = date.getMonth() + 1;
month = month < 10 ? "0" + month : month;
var day = date.getDate();
day = day < 10 ? "0" + day : day;
var mydate = year.toString() + '-' + month.toString() + '-' +day.toString();

 

new Date(+new Date()+8*3600*1000).toISOString().replace(/T/g,' ').replace(/\.[\d]{3}Z/,'')

posted @ 2017-09-28 19:18  abcByme  阅读(368)  评论(0编辑  收藏  举报