From 327a67004dd2fb5f819ddf5166d52e235a8de988 Mon Sep 17 00:00:00 2001 From: Jonathan Sykes Date: Sat, 4 Jul 2026 12:49:41 +0800 Subject: [PATCH] Show build time in GMT+8 with 'built N ago' in Settings About --- frontend/app.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/app.js b/frontend/app.js index 73f54e0..223f3b9 100755 --- a/frontend/app.js +++ b/frontend/app.js @@ -2161,7 +2161,18 @@ async function renderSettings() { const bt = $('aboutBuildTime'); if (bt) { const t = v.buildTime ? new Date(v.buildTime) : null; - bt.textContent = t && !isNaN(t) ? t.toLocaleString() : 'unknown'; + if (t && !isNaN(t)) { + // Shown in GMT+8 regardless of device/server timezone, plus build age. + const gmt8 = new Date(t.getTime() + 8 * 3600e3).toISOString().replace('T', ' ').slice(0, 16); + const s = Math.max(0, Math.floor((Date.now() - t.getTime()) / 1000)); + const ago = s < 60 ? `${s} second${s === 1 ? '' : 's'} ago` + : s < 3600 ? `${Math.floor(s / 60)} minute${Math.floor(s / 60) === 1 ? '' : 's'} ago` + : s < 86400 ? `${Math.floor(s / 3600)} hour${Math.floor(s / 3600) === 1 ? '' : 's'} ago` + : `${Math.floor(s / 86400)} day${Math.floor(s / 86400) === 1 ? '' : 's'} ago`; + bt.textContent = `${gmt8} +08 · built ${ago}`; + } else { + bt.textContent = 'unknown'; + } } } } catch { /* offline — leave the static version in place */ }