Skip to content

[ES|QL] Supports timezone#247917

Merged
stratoula merged 27 commits intoelastic:mainfrom
stratoula:timezone-support-esql
Feb 4, 2026
Merged

[ES|QL] Supports timezone#247917
stratoula merged 27 commits intoelastic:mainfrom
stratoula:timezone-support-esql

Conversation

@stratoula
Copy link
Copy Markdown
Contributor

@stratoula stratoula commented Jan 6, 2026

Summary

Closes #172221

ES|QL now supports timezones! This PR is adding support to:

  • our esql expression. The applications that are using the expression are getting this for free
  • consumers of the getESQLResults utility
  • all analyst xp apps

There are usages (such as in ML) that are still not supporting it. The teams need to handle it themselves. I didnt do it mostly for 2 reasons:

  • I dont know the apps and the code
  • it is very complicated to do so

When we will merge

I am going to merge it after the next serverless release (next week) to be sure that all the ES serverless instances have the new request parameter already.

@stratoula stratoula changed the title [ES|QL] Supports timezone in Discover/Dashboards [ES|QL] Supports timezone Jan 7, 2026
@stratoula stratoula added Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// v9.4.0 release_note:enhancement backport:skip This PR does not require backporting labels Jan 7, 2026
@stratoula stratoula marked this pull request as ready for review January 23, 2026 15:28
@stratoula stratoula requested review from a team as code owners January 23, 2026 15:28
@stratoula stratoula requested a review from hop-dev January 23, 2026 15:28
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@stratoula stratoula removed request for a team January 30, 2026 08:24
@stratoula stratoula marked this pull request as ready for review January 30, 2026 11:54
Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Presentation team additions looking nice and straightforward. LGTM!

Copy link
Copy Markdown
Contributor

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

Code review only, LGTM thanks

Copy link
Copy Markdown
Contributor

@sddonne sddonne left a comment

Choose a reason for hiding this comment

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

Code review only, ES|QL lgtm.

Copy link
Copy Markdown
Contributor

@mohamedhamed-ahmed mohamedhamed-ahmed left a comment

Choose a reason for hiding this comment

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

Code review only, LGTM! Thank you

Copy link
Copy Markdown
Contributor

@mykolaharmash mykolaharmash left a comment

Choose a reason for hiding this comment

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

significant events changes LGTM

@stratoula stratoula removed the request for review from hop-dev February 4, 2026 07:27
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/es-types 33 34 +1
@kbn/esql-utils 132 133 +1
total +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 199.4KB 199.4KB +10.0B
controls 526.8KB 527.0KB +166.0B
dashboard 810.6KB 810.6KB -4.0B
discover 1.6MB 1.6MB +10.0B
esql 740.8KB 741.0KB +232.0B
lens 2.0MB 2.0MB +49.0B
maps 3.2MB 3.2MB +85.0B
securitySolution 10.8MB 10.8MB +75.0B
stackAlerts 69.2KB 69.4KB +153.0B
streamsApp 1.7MB 1.7MB +186.0B
total +962.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
console 27.7KB 27.8KB +62.0B
data 444.3KB 444.4KB +77.0B
kbnUiSharedDeps-srcJs 4.5MB 4.5MB +31.0B
lens 64.4KB 64.5KB +74.0B
streamsApp 22.9KB 23.0KB +133.0B
total +377.0B
Unknown metric groups

API count

id before after diff
@kbn/es-types 33 34 +1
@kbn/esql-utils 192 193 +1
total +2

History

@stratoula stratoula merged commit 857889a into elastic:main Feb 4, 2026
16 checks passed
mariairiartef added a commit that referenced this pull request Feb 19, 2026
…53912)

## Summary

Closes elastic/kibana-team#2888

> [!NOTE]
> Timezone support was added in
#247917 and it works out of the
box.

- Enables ES|QL conversion for all timezones by removing the timezone
check in the `generate_esql_query` method.
- Deletes the related failure reason since is no longer necessary.
- Removes the timezone related test in the `generate_esql_query` test
since we have removed the timezone checks in the `generate_esql_query`
method.

### Screen recording
Time zone: America/Jujuy


https://github.com/user-attachments/assets/d815769c-bb81-487c-8b85-faf3b02473aa

## Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
ersin-erdal pushed a commit to ersin-erdal/kibana that referenced this pull request Feb 19, 2026
…astic#253912)

## Summary

Closes elastic/kibana-team#2888

> [!NOTE]
> Timezone support was added in
elastic#247917 and it works out of the
box.

- Enables ES|QL conversion for all timezones by removing the timezone
check in the `generate_esql_query` method.
- Deletes the related failure reason since is no longer necessary.
- Removes the timezone related test in the `generate_esql_query` test
since we have removed the timezone checks in the `generate_esql_query`
method.

### Screen recording
Time zone: America/Jujuy


https://github.com/user-attachments/assets/d815769c-bb81-487c-8b85-faf3b02473aa

## Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
florent-leborgne added a commit to elastic/docs-content that referenced this pull request Mar 23, 2026
## Summary

Adds a **Timezone handling** section to the [ES|QL in
Kibana](https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql-kibana)
page, under the existing "Filter by time" section.

This is Kibana-specific content not covered in the ES|QL reference: it
explains how Kibana controls the timezone used in ES|QL queries.

**What it covers:**
- By default, Kibana applies the **Time zone** (`dateFormat:tz`)
[advanced
setting](https://www.elastic.co/docs/reference/kibana/configuration-reference/advanced-settings)
to all ES|QL queries in Discover, dashboards, alerting, and Maps.
- A warning advising against using `SET time_zone` in Kibana apps: the
directive changes how dates are computed by ES, but Kibana still
displays timestamps using `dateFormat:tz`, which can produce confusing
results. Based on feedback from @stratoula and @ghudgins.

**Verified against the Kibana codebase:**
- `dateFormat:tz` is passed to ES|QL queries via
`data/common/search/expressions/esql.ts` (line 185)
- `SET time_zone` is intentionally excluded from autocomplete in
`kbn-esql-language/scripts/generate_settings.ts`

**Manually tested using `DATE_FORMAT("yyyy-MM-dd HH:mm z", @timestamp)`
to confirm the timezone applied:**
- **Discover**: returns the timezone from the `dateFormat:tz` advanced
setting ✅
- **Data Visualizer**: same behavior as Discover ✅
- **Dev Tools (no `time_zone` param)**: returns `Z` (UTC) ✅
- **Discover & Data Visualizer with `SET time_zone =
"America/New_York"`**: returns `EST`/`EDT`, overriding the advanced
setting ✅

Closes #4962

Supersedes #5456 (timezone content consolidated into this PR).

Related Kibana PR:
- [elastic/kibana#247917](elastic/kibana#247917)
— ES|QL timezone support

## Generative AI disclosure

1. Did you use a generative AI (GenAI) tool to assist in creating this
contribution?
- [x] Yes
- [ ] No

2. If you answered "Yes" to the previous question, please specify the
tool(s) and model(s) used (e.g., Google Gemini, OpenAI ChatGPT-4, etc.).

Tool(s) and model(s) used: claude-4.6-sonnet-medium and
claude-4.6-opus-high-thinking in Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana release_note:enhancement Team:ESQL ES|QL related features in Kibana t// v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ES|QL] Reenable support for the time_zone param in ES|QL requests