Skip to content

[Backport 2.19-dev] Default to UTC for date/time functions across PPL and SQL - #3920

Merged
penghuo merged 1 commit into
opensearch-project:2.19-devfrom
yuancu:backport/backport-3854-to-2.19-dev
Jul 25, 2025
Merged

penghuo merged 1 commit into
opensearch-project:2.19-devfrom
yuancu:backport/backport-3854-to-2.19-dev

Conversation

@yuancu

@yuancu yuancu commented Jul 24, 2025

Copy link
Copy Markdown
Collaborator

Description

Backport #3854 to 2.19-dev

Related Issues

#3725

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…-project#3854)

* Use UTC for all date/time related functions

Signed-off-by: Yuanchun Shen <[email protected]>

* Change zone ID to UTC in date/time tests

Signed-off-by: Yuanchun Shen <[email protected]>

* Update now's timezone to UTC in datetime documentation

Signed-off-by: Yuanchun Shen <[email protected]>

* Add a test to compare against UTC date

Signed-off-by: Yuanchun Shen <[email protected]>

* Revert changes to sysdate: make it return timestamp in cluster timezone

Signed-off-by: Yuanchun Shen <[email protected]>

* Correct utc_time and utc_timestamp to return time in HH:mm:ss format (intead of with random length of milliseconds)

Signed-off-by: Yuanchun Shen <[email protected]>

* Update datetime function documentations to highlight changes to UTC for now-like functions

Signed-off-by: Yuanchun Shen <[email protected]>

* Correct phrasing of sysdate and some other datetime function documentations

Signed-off-by: Yuanchun Shen <[email protected]>

* Add a note directive block at the top of datetime to describe the time zone behavior

Signed-off-by: Yuanchun Shen <[email protected]>

* Revert "Revert changes to sysdate: make it return timestamp in cluster timezone"

This reverts commit b7be897.

Signed-off-by: Yuanchun Shen <[email protected]>

* Update sysdate's description

Signed-off-by: Yuanchun Shen <[email protected]>

* Update datetime.rst

- remove expressions indicating PPL supporting other time zones

Signed-off-by: Yuanchun Shen <[email protected]>

* Add STRING to allowed first parameter of convert_tz as it returns null for malformatted date

Signed-off-by: Yuanchun Shen <[email protected]>

* Restrict the format of convert_tz's argument

Signed-off-by: Yuanchun Shen <[email protected]>

---------

Signed-off-by: Yuanchun Shen <[email protected]>
(cherry picked from commit b3c0177)
@yuancu
yuancu force-pushed the backport/backport-3854-to-2.19-dev branch from 3f3ef46 to 52b892c Compare July 24, 2025 12:07
@penghuo
penghuo merged commit 6d0e0df into opensearch-project:2.19-dev Jul 25, 2025
@yuancu
yuancu deleted the backport/backport-3854-to-2.19-dev branch July 26, 2025 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants