Skip to content

[docs] add sql example to timestamp/datetime docs for time zone #21082

Merged
berkaysynnada merged 2 commits intoapache:mainfrom
buraksenn:add-sql-examples-to-date-time-documentation
Apr 2, 2026
Merged

[docs] add sql example to timestamp/datetime docs for time zone #21082
berkaysynnada merged 2 commits intoapache:mainfrom
buraksenn:add-sql-examples-to-date-time-documentation

Conversation

@buraksenn
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

#19104 explains but some datetime functions respect execution.time_zone config but there are no SQL examples for them. This PR adds it and also missing sql example for date_part, extract and date_trunc

What changes are included in this PR?

sql example changes and generated doc

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions Bot added documentation Improvements or additions to documentation functions Changes to functions implementation labels Mar 20, 2026
@buraksenn buraksenn force-pushed the add-sql-examples-to-date-time-documentation branch from f76f64f to b446c28 Compare March 20, 2026 18:15
@buraksenn buraksenn force-pushed the add-sql-examples-to-date-time-documentation branch from b446c28 to 27832b9 Compare March 20, 2026 18:16
@buraksenn
Copy link
Copy Markdown
Contributor Author

Can you review this if you've time @berkaysynnada?

Copy link
Copy Markdown
Contributor

@berkaysynnada berkaysynnada left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @buraksenn

Might be worth double-checking a couple of things:

  1. current_time(): Europe/London in December should be UTC+0, so the +1h offset might not hold, so it could be worth picking a timezone with a clear winter offset.
  2. now(): the "Z" suffix after switching to America/New_York might be incorrect since "Z" means UTC, but the return type carries the session timezone. Might want to run it locally to confirm what actually gets printed

@buraksenn
Copy link
Copy Markdown
Contributor Author

buraksenn commented Apr 2, 2026

lgtm, thanks @buraksenn

Might be worth double-checking a couple of things:

1. `current_time()`: Europe/London in December should be UTC+0, so the +1h offset might not hold, so it could be worth picking a timezone with a clear winter offset.

2. now(): the "Z" suffix after switching to America/New_York might be incorrect since "Z" means UTC, but the return type carries the session timezone. Might want to run it locally to confirm what actually gets printed

I've run the cli and verified each now. There was some mistakes that I've missed thanks @berkaysynnada

@berkaysynnada berkaysynnada added this pull request to the merge queue Apr 2, 2026
Merged via the queue into apache:main with commit d86874e Apr 2, 2026
28 of 29 checks passed
@berkaysynnada berkaysynnada deleted the add-sql-examples-to-date-time-documentation branch April 2, 2026 21:17
zhuqi-lucas pushed a commit to zhuqi-lucas/arrow-datafusion that referenced this pull request Apr 4, 2026
…he#21082)

## Which issue does this PR close?
- Closes apache#19104.

## Rationale for this change
apache#19104 explains but some datetime functions respect
`execution.time_zone` config but there are no SQL examples for them.
This PR adds it and also missing sql example for `date_part`, `extract`
and `date_trunc`

## What changes are included in this PR?
sql example changes and generated doc

## Are these changes tested?

## Are there any user-facing changes?
Rich-T-kid pushed a commit to Rich-T-kid/datafusion that referenced this pull request Apr 21, 2026
…he#21082)

## Which issue does this PR close?
- Closes apache#19104.

## Rationale for this change
apache#19104 explains but some datetime functions respect
`execution.time_zone` config but there are no SQL examples for them.
This PR adds it and also missing sql example for `date_part`, `extract`
and `date_trunc`

## What changes are included in this PR?
sql example changes and generated doc

## Are these changes tested?

## Are there any user-facing changes?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Update SQL examples in documentation for timestamp/datetime functions

2 participants