Skip to content

Fix bug in handling schedules when EndTime < StartTime and are in different timezones - #574

Merged
chrjohn merged 2 commits into
quickfix-j:masterfrom
AndreyNudko:fix-486
Jun 25, 2024
Merged

chrjohn merged 2 commits into
quickfix-j:masterfrom
AndreyNudko:fix-486

Conversation

@AndreyNudko

@AndreyNudko AndreyNudko commented Nov 18, 2022 •

Copy link
Copy Markdown
Contributor

It was possible to end up in a state when interval end is >24 hours before interval start (this is some quirk of the j.u.Calendar which I don't fully understand - but order of calls to setTimeZone() and setTimeInMillis() somehow matters). Adding 1 day in this case is not enough, since resulting interval is still inverted. This patch addresses the problem by moving end timestamp forward as long as it is behind the start.

Fixes #486

…ferent timezones

It was possible to end up in a state when interval end is >24 hours before interval start (this is some quirk of the j.u.Calendar which I don't fully understand - but order of calls to setTimeZone() and setTimeInMillis() somehow matters). Adding 1 day in this case is not enough, since resulting interval is still inverted.
This patch addresses the problem by moving end timestamp forward as long as it is behind the start.

quickfix-j#486
@chrjohn chrjohn changed the title Fix bug in handling schedules when EndTime < StartTime and are in different timezones Fix bug in handling schedules when EndTime < StartTime and are in different timezones Jan 4, 2023
@chrjohn chrjohn added this to the QFJ 3.0.0 milestone Dec 28, 2023
@chrjohn
chrjohn merged commit 9335f8d into quickfix-j:master Jun 25, 2024
@IvanOVasiliev

Copy link
Copy Markdown

What version of qfj contains this fix?

@chrjohn

chrjohn commented Nov 5, 2025

Copy link
Copy Markdown
Member

It's in the QFJ3.0.0 milestone, but it is yet to be released.

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.

Configuring StartTime and EndTime on different timezones results in wrong schedule calculation

3 participants