fix: update the timezone

This commit is contained in:
2026-07-14 22:22:51 +07:00
parent 1c9efe32a2
commit ece079e71f
22 changed files with 170 additions and 88 deletions
+3
View File
@@ -0,0 +1,3 @@
// Application display and reporting timezone. Timestamps remain stored as UTC
// ISO strings; this value is only used when presenting or grouping instants.
export const VIETNAM_TIME_ZONE = "Asia/Ho_Chi_Minh";
+3 -1
View File
@@ -1,9 +1,11 @@
import { VIETNAM_TIME_ZONE } from "../config/time.js";
// Debug logging utility — only active in dev mode (NODE_ENV !== "production")
// Outputs are tagged with [DBG:tag] for easy grep/filter
const isDev = process.env.NODE_ENV !== "production";
function ts() {
return new Date().toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
return new Date().toLocaleTimeString("en-US", { timeZone: VIETNAM_TIME_ZONE, hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
}
export function dbg(tag, msg) {
+2 -1
View File
@@ -1,10 +1,11 @@
// Stream handler with disconnect detection - shared for all providers
import { STREAM_STALL_TIMEOUT_MS } from "../config/runtimeConfig.js";
import { VIETNAM_TIME_ZONE } from "../config/time.js";
import { dbg, isDebugEnabled } from "./debugLog.js";
// Get HH:MM:SS timestamp
function getTimeString() {
return new Date().toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
return new Date().toLocaleTimeString("en-US", { timeZone: VIETNAM_TIME_ZONE, hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
}
/**