js acquires the current date becomes format yyyy-MM-dd

 var time = new Date();
            var day = ("0" + time.getDate()).slice(-2);
            var month = ("0" + (time.getMonth() + 1)).slice(-2);
            var today = time.getFullYear() + "-" + (month) + "-" + (day);
Published 16 original articles · won praise 0 · Views 195

Guess you like

Origin blog.csdn.net/Jeremz/article/details/104572541