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);
js acquires the current date becomes format yyyy-MM-dd
Guess you like
Origin blog.csdn.net/Jeremz/article/details/104572541
Ranking