export const TZ_STORAGE_KEY = "apothecary.timezone"; const enCA = (tz: string) => new Intl.DateTimeFormat("en-CA", { timeZone: tz, year: "numeric", month: "2-digit", day: "2-digit", }); export function getToday(tz: string): string { return enCA(tz).format(new Date()); } export function getBrowserTimezone(): string { return Intl.DateTimeFormat().resolvedOptions().timeZone; } export function getStoredTimezone(): string { return localStorage.getItem(TZ_STORAGE_KEY) || getBrowserTimezone(); }