()
| 70 | let cachedTimeZone: string | null = null |
| 71 | |
| 72 | export function getTimeZone(): string { |
| 73 | if (!cachedTimeZone) { |
| 74 | cachedTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone |
| 75 | } |
| 76 | return cachedTimeZone |
| 77 | } |
| 78 | |
| 79 | // System locale language subtag (e.g. 'en', 'ja') is constant for the process |
| 80 | // lifetime. null = not yet computed; undefined = computed but unavailable (so |