【javascript】获取 格式化时间

  function getDate() {
var myDate = new Date();
var month = myDate.getMonth() + 1;
var day = myDate.getDate();
month = (month.toString().length == 1) ? ("0" + month) : month;
day = (day.toString().length == 1) ? ("0" + day) : day; var result = myDate.getFullYear() + month + day; //当前日期 return result;
} //
上一篇:外贸建站之图片预加载JS代码分享


下一篇:spark1.4