Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix timezone conversion in datetime trigger parameters#54593

Merged
pierrejeambrun merged 6 commits intoapache:mainfrom
steveahnahn:fix-trigger-date-time-conversion-bug
Sep 1, 2025
Merged

Fix timezone conversion in datetime trigger parameters#54593
pierrejeambrun merged 6 commits intoapache:mainfrom
steveahnahn:fix-trigger-date-time-conversion-bug

Conversation

Copy link
Contributor

steveahnahn commented Aug 18, 2025 *
edited
Loading

Summary

Fixes a bug where datetime parameter inputs in the Airflow UI were applying timezone conversion twice, causing incorrect scheduling times. When users selected a local time via the datetime picker, the actual trigger time would be offset by double the timezone difference.

Problem

  1. User picks "5:25 PM" local time (Pacific UTC-7)
  2. DateTimeInput converts to UTC: "2025-08-17T00:25:00.000Z"
  3. FieldDateTime adds fake UTC suffix: "2025-08-17T00:25:00.000Z:00+00:00"
  4. This malformed string gets parsed incorrectly
  5. Results in wrong final datetime (appeared like double conversion)

Solution

DateTimeInput handles all conversions, other components pass UTC values unchanged

  1. DateTimeInput: Maintains proper timezone conversion (local display -> UTC)
  2. FieldDateTime: Removed faulty conditional that was adding fake UTC suffixes to already-converted values

Testing

  • Manual testing with Pacific (UTC-7) timezone and verified DAG triggers execute at correct times
  • Confirmed no double conversion in browser console logs

Related Issues

resolves #54466

steveahnahn requested review from bbovenzi, jscheffl, pierrejeambrun, ryanahamilton and shubhamraj-git as code owners August 18, 2025 01:22
Copy link

boring-cyborg bot commented Aug 18, 2025

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better .
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Aug 18, 2025
ashb added this to the Airflow 3.0.6 milestone Aug 18, 2025
Copy link
Contributor

bbovenzi commented Aug 18, 2025

Thanks for the fix!
Can you test the Trigger Dag and Run Backfill forms to make sure they're still using the correct timezones?

bbovenzi added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Aug 18, 2025
bbovenzi reviewed Aug 18, 2025
bbovenzi mentioned this pull request Aug 18, 2025
steveahnahn force-pushed the fix-trigger-date-time-conversion-bug branch from 773374f to b8e118b Compare August 18, 2025 21:23
Copy link
Contributor Author

steveahnahn commented Aug 18, 2025

Additional testing done with Trigger Dag, Trigger Dag advanced configurations & Run Backfill

steveahnahn force-pushed the fix-trigger-date-time-conversion-bug branch from b8e118b to e1560fb Compare August 21, 2025 20:15
kaxil modified the milestones: Airflow 3.0.6, Airflow 3.0.7 Aug 21, 2025
steveahnahn force-pushed the fix-trigger-date-time-conversion-bug branch from e1560fb to 161f02d Compare August 22, 2025 03:47
steveahnahn force-pushed the fix-trigger-date-time-conversion-bug branch from 161f02d to e2686db Compare August 22, 2025 05:52
Copy link
Contributor Author

steveahnahn commented Aug 25, 2025 *
edited
Loading

Fixed datetime parameter timezone conversion bug by removing faulty string manipulation in FieldDateTime that was corrupting properly converted UTC values from DateTimeInput. @pierrejeambrun

pierrejeambrun approved these changes Sep 1, 2025
Copy link
Member

pierrejeambrun left a comment *
edited
Loading

Choose a reason for hiding this comment

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

LGTM. (tested the trigger run params + backfill form)

pierrejeambrun merged commit dd99815 into apache:main Sep 1, 2025
53 checks passed
Copy link

boring-cyborg bot commented Sep 1, 2025

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

github-actions bot pushed a commit that referenced this pull request Sep 1, 2025
...54593)

* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------
(cherry picked from commit dd99815)

Co-authored-by: Steve Ahn
Co-authored-by: AhnSteve
Copy link

github-actions bot commented Sep 1, 2025

Backport successfully created: v3-0-test

Status Branch Result
v3-0-test

pierrejeambrun pushed a commit that referenced this pull request Sep 1, 2025
...54593) (#55141)

* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------
(cherry picked from commit dd99815)

Co-authored-by: Steve Ahn
Co-authored-by: AhnSteve
nothingmin pushed a commit to nothingmin/airflow that referenced this pull request Sep 2, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
kaxil modified the milestones: Airflow 3.0.7, Airflow 3.1.0 Sep 13, 2025
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Sep 30, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 1, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 2, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 3, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 4, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 5, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 5, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 7, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 8, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 9, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 10, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 11, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 12, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 14, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 15, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 17, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
abdulrahman305 bot pushed a commit to qenex-ai/airflow that referenced this pull request Oct 19, 2025
* onChange utc conversio bug

* isValid

* lint

* revert & workaround

* fix cmt lint

* add back support for sec/ms

---------

Co-authored-by: AhnSteve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

bbovenzi bbovenzi left review comments

pierrejeambrun pierrejeambrun approved these changes

ryanahamilton Awaiting requested review from ryanahamilton ryanahamilton is a code owner

jscheffl Awaiting requested review from jscheffl

shubhamraj-git Awaiting requested review from shubhamraj-git shubhamraj-git is a code owner

Assignees

No one assigned

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Milestone

Airflow 3.1.0

Development

Successfully merging this pull request may close these issues.

Date-time DAG param UI issues

6 participants