timezone.ts 507 B

123456789101112
  1. // Node-only: reads `process.env`. Re-exported via `@pipeline/shared/node`,
  2. // never from the client-safe main barrel.
  3. import { DEFAULT_TIMEZONE } from "./date.js";
  4. /**
  5. * Timezone used for every displayed and folder date. Defaults to Asia/Shanghai
  6. * (correct for a Beijing-daily product regardless of the host/container clock);
  7. * override with the `TIMEZONE` env var (e.g. `TIMEZONE=America/Los_Angeles`).
  8. */
  9. export function getTimezone(): string {
  10. return process.env.TIMEZONE || DEFAULT_TIMEZONE;
  11. }