js根据当前日期并展示为2018-08-13格式
1、js获取当前日期var date = new Date();var seperator1 = "-";

3、js将获得的年月日进行字符串拼接if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var currentdate = year + seperator1 + month + seperator1 + strDate;
