在js文件里获取年月日 var d,s; d = new Date(); s = d.getYear() + "-"; //取年份 s = s + (d.getMonth() + 1) + "-";//取月份 s += d.getDate() + " "; //取日期