var nowDate = new Date();var day = nowDate.getDate();var month = nowDate.getMonth();var year = nowDate.getFullYear();var CurrentDate = year+"-"+(month<10?"0"+month:month)+"-"+(day<10?"0"+day:day);
格式: 2018-01-02
JQuery-四行生成当前日期yyyy-MM-dd
原文地址:https://www.cnblogs.com/Night-Watch/p/9493679.html