//获取当前日期(年月日),如:2017-12-18 function getNowDate() { var dd = new Date(); var y = dd.getFullYear(); //获取当前月份的日期,不足10补0 var m = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取当前几号,不足10补0 var d = dd.getDate() < 10 ? '0'…
链接:https://www.cnblogs.com/visi_zhangyang/p/3490122.html js中获得当前时间是年份和月份,形如:201208 //获取完整的日期 var date=new Date; var year=date.getFullYear(); var month=date.getMonth()+1; month =(month<10 ? "0"+month:month); var mydate = (year.toString…