Skip to content

Fix UTC±NN00 cannot be parsed in SQL - #22244

Merged
Mytherin merged 1 commit into
duckdb:v1.5-variegatafrom
tianjq16:bugfix_utc_timezone_cannot_be_parsed
Apr 25, 2026
Merged

Mytherin merged 1 commit into
duckdb:v1.5-variegatafrom
tianjq16:bugfix_utc_timezone_cannot_be_parsed

Conversation

@tianjq16

Copy link
Copy Markdown
Contributor

I noticed that DuckDB now supports timezones in the UTC±NN00 format; however, this format can currently only be used within the SET TIMEZONE= statement and cannot be used directly within queries. Therefore, I submit this patch to fix this issue.

@hawkfish
hawkfish self-requested a review April 23, 2026 16:27
Comment thread extension/icu/icu_extension.cpp Outdated

unique_ptr<icu::TimeZone> GetTimeZoneInternal(string &tz_str, vector<string> &candidates) {
tz_str = NormalizeTimeZone(tz_str);
auto tz = GetKnownTimeZone(tz_str);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NormalizeTimeZone already calls GetKnownTimeZone so this is doing double work now. Maybe this code should be cleaned up a bit?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion. Currently, the only function exposed externally is GetNormalizedTimeZone. Indeed, GetKnownTimeZone should no longer be called by any function other than GetNormalizedTimeZone.

@tianjq16
tianjq16 force-pushed the bugfix_utc_timezone_cannot_be_parsed branch from 2caf3cb to 9102b00 Compare April 24, 2026 03:14
@duckdb-draftbot
duckdb-draftbot marked this pull request as draft April 24, 2026 03:14
@tianjq16
tianjq16 marked this pull request as ready for review April 24, 2026 03:15
@Mytherin
Mytherin merged commit f0413bf into duckdb:v1.5-variegata Apr 25, 2026
111 checks passed
@Mytherin

Copy link
Copy Markdown
Collaborator

Thanks!

kaka11chen pushed a commit to kaka11chen/astrovela_vane that referenced this pull request Aug 14, 2026
I noticed that DuckDB now supports timezones in the `UTC±NN00` format;
however, this format can currently only be used within the `SET
TIMEZONE= ` statement and cannot be used directly within queries.
Therefore, I submit this patch to fix this issue.

Upstream-Commit: duckdb/duckdb@f0413bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants