const myDate =new Date(); const Y = myDate.getFullYear(); const M = myDate.getMonth()+1; const D = myDate.getDate(); const curDay = Y + '-'+ M + '-' + D; console.log(curDay)