util.time.js 274 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 10 11 12 13 export function getCurDate() { let date = new Date() let year = date.getFullYear(); let month = date.getMonth() + 1; let dates = date.getDate() return { year: year, month: month > 9 ? month : `0${month}`, date: dates > 9 ? dates : `0${dates}` }; }