new date 转换为年月日


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)
posted @ 2021-12-30 21:11  Li_ll  Views(810)  Comments(1Edit  收藏  举报