update html

This commit is contained in:
Shuanglei Tao
2025-06-26 00:00:56 +08:00
parent f9b6f2753d
commit 46c31ae7d7

View File

@@ -312,7 +312,13 @@ function handleNotify(value, idx) {
updateDitcherOptions();
} else {
if (textDecoder == null) textDecoder = new TextDecoder();
addLog(textDecoder.decode(data), '⇓');
const msg = textDecoder.decode(data);
addLog(msg, '⇓');
if (msg.startsWith('t=') && msg.length > 2) {
const t = parseInt(msg.substring(2)) + new Date().getTimezoneOffset() * 60;
addLog(`远端时间: ${new Date(t * 1000).toLocaleString()}`);
addLog(`本地时间: ${new Date().toLocaleString()}`);
}
}
}