js get the current year, month, date - implementation code in YYYYmmDD format
var nowDate = new Date(); var year = nowDate.getFullYear(); var month = nowDate.getMonth() + 1 < 10 ? "0" + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1; var day = nowDate.getDate() < 10 ? "0" + nowDate.getDate() : nowDate .getDate(); var dateStr = year + "-" + month + "-" + day;
The above article js gets the current year, month, date, and implementation code of YYYYmmDD format is all the content I have shared with you. I hope you can give you a reference and I hope you can support Wulin.com more.