date=Thu Dec 28 2023 16:44:25 GMT+0800 (中国标准时间)
function formatDate(date) { const year = date.getFullYear(); const month = ('0' + (date.getMonth() + 1)).slice(-2); const day = ('0' + date.getDate()).slice(-2); const hour = ('0' + date.getHours()).slice(-2); const minute = ('0' + date.getMinutes()).slice(-2); const second = ('0' + date.getSeconds()).slice(-2); return { yd: {month}-{hour}:{second}, hs: {minute}:${second} } }