-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Fix timezone conversion in datetime trigger parameters#54593
Fix timezone conversion in datetime trigger parameters#54593pierrejeambrun merged 6 commits intoapache:mainfrom
Conversation
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
- User picks "5:25 PM" local time (Pacific UTC-7)
- DateTimeInput converts to UTC: "2025-08-17T00:25:00.000Z"
- FieldDateTime adds fake UTC suffix: "2025-08-17T00:25:00.000Z:00+00:00"
- This malformed string gets parsed incorrectly
- Results in wrong final datetime (appeared like double conversion)
Solution
DateTimeInput handles all conversions, other components pass UTC values unchanged
DateTimeInput: Maintains proper timezone conversion (local display -> UTC)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
|
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)
|
|
Thanks for the fix! |
airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldDateTime.tsx
Outdated
Show resolved
Hide resolved
773374f to
b8e118b
Compare
|
Additional testing done with Trigger Dag, Trigger Dag advanced configurations & Run Backfill |
b8e118b to
e1560fb
Compare
e1560fb to
161f02d
Compare
161f02d to
e2686db
Compare
|
Fixed datetime parameter timezone conversion bug by removing faulty string manipulation in |
There was a problem hiding this comment.
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)
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve
* isValid
* lint
* revert & workaround
* fix cmt lint
* add back support for sec/ms
---------
Co-authored-by: AhnSteve