{"record":{"id":"380735f6f59d1ae8","repo":"cube-js/cube","slug":"unknown-iana-timezone-iana-cannot-convert-to","errorCode":null,"errorMessage":"Unknown IANA timezone '${iana}'. Cannot convert to a Windows timezone name for MSSQL AT TIME ZONE.","messagePattern":"Unknown IANA timezone '(.+?)'\\. Cannot convert to a Windows timezone name for MSSQL AT TIME ZONE\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-schema-compiler/src/adapter/windows-iana.ts","lineNumber":460,"sourceCode":"  'Pacific/Palau': 'Tokyo Standard Time',\n  'Pacific/Pitcairn': 'UTC-08',\n  'Pacific/Ponape': 'Central Pacific Standard Time',\n  'Pacific/Port_Moresby': 'West Pacific Standard Time',\n  'Pacific/Rarotonga': 'Hawaiian Standard Time',\n  'Pacific/Saipan': 'West Pacific Standard Time',\n  'Pacific/Tahiti': 'Hawaiian Standard Time',\n  'Pacific/Tarawa': 'UTC+12',\n  'Pacific/Tongatapu': 'Tonga Standard Time',\n  'Pacific/Truk': 'West Pacific Standard Time',\n  'Pacific/Wake': 'UTC+12',\n  'Pacific/Wallis': 'UTC+12',\n  'UTC': 'UTC',\n};\n\nexport function resolveWindowsTimezone(iana: string): string {\n  const windowsTz = ianaToWindows[iana];\n  if (!windowsTz) {\n    throw new Error(\n      `Unknown IANA timezone '${iana}'. Cannot convert to a Windows timezone name for MSSQL AT TIME ZONE.`\n    );\n  }\n\n  return windowsTz;\n}\n","sourceCodeStart":442,"sourceCodeEnd":467,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-schema-compiler/src/adapter/windows-iana.ts#L442-L467","documentation":"MSSQL AT TIME ZONE requires Windows timezone names, so Cube maps IANA tz names to Windows ones via a static lookup table. resolveWindowsTimezone throws when the given IANA identifier is absent from ianaToWindows (no equivalent mapping exists in the table).","triggerScenarios":"Calling resolveWindowsTimezone(iana) (or windowsTz) with an IANA id not in the table — obscure zones, aliases, or invalid strings — typically while compiling an MSSQL query with a non-UTC timezone parameter.","commonSituations":"Setting timestamp precision/timezone in Cube config to a niche IANA zone (e.g. 'America/Argentina/ComodRivadavia' or a misspelled 'Europe/Kyiv' on an older table) with a MSSQL/ JDBC driver; using timezone strings from user input.","solutions":["Use a widely supported IANA name that has a Windows equivalent (e.g. 'Europe/Kiev', 'America/New_York')","Normalize aliases first (e.g. via Intl API or moment-timezone) before calling","Update the ianaToWindows table (or file an issue/PR) if a legitimate zone is missing","Validate tz strings at config load time rather than at query time"],"exampleFix":"// before\nresolveWindowsTimezone('Europe/Kyiv');\n// after\nresolveWindowsTimezone('Europe/Kiev'); // mapped entry in ianaToWindows","handlingStrategy":"fallback","validationCode":"// optional pre-check against the mapping table\nconst known = require('./windows-iana');\nconst ianaToWindows = known.ianaToWindows || {};\nconst ok = iana in ianaToWindows || iana === 'UTC';","typeGuard":null,"tryCatchPattern":"try { tz = resolveWindowsTimezone(iana); } catch (e) { if (e.message.startsWith('Unknown IANA timezone')) { tz = resolveWindowsTimezone(normalizeAlias(iana) || 'UTC'); } else throw e; }","preventionTips":["Restrict configurable timezones to a vetted allowlist","Normalize tz aliases with Intl/moment-timezone before use","Pin and update the IANA mapping table when upgrading Cube"],"tags":["timezone","mssql","iana","windows"],"backgroundTag":"unknown-timezone","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}