refactor: 优化时间格式化函数

This commit is contained in:
Wenjie Zhang 2025-06-18 21:43:44 +08:00
parent c6ab72cd5b
commit e1b02e0458

View File

@ -641,9 +641,9 @@ const openFileDetail = (record) => {
} }
} }
const formatRelativeTime = (timestamp) => { const formatRelativeTime = (timestamp, offset = 0) => {
// UTC+8 // UTC+8offset80
const timezoneOffset = 8 * 60 * 60 * 1000; // const timezoneOffset = offset * 60 * 60 * 1000; //
const adjustedTimestamp = timestamp + timezoneOffset; const adjustedTimestamp = timestamp + timezoneOffset;
const now = Date.now(); const now = Date.now();