formatDatedate const year = dategetFullYear; const month = dategetMonth + 1; const day = dategetDate; return year+month+day; 修改上
function formatDate(date) { const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0'); return year + '-' + month + '-' + day; }
原文地址: https://www.cveoy.top/t/topic/jdYM 著作权归作者所有。请勿转载和采集!