| | |
| | | const hours = String(date.getHours()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | // 只显示年月日,如果需要显示时间,则拼接 hours + ':' + minutes + ':' + seconds |
| | | return `${year}-${month}-${day}`; |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | |
| | | const hours = String(date.getHours()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零(如果需要显示时间) |
| | | // 只显示年月日,如果需要显示时间,则拼接 hours + ':' + minutes + ':' + seconds |
| | | return `${year}-${month}-${day}`; |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | onUnmounted(() => { |
| | | if (socket) { |