Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should compare date and time values with different time zones #767

Open
till-stadtler opened this issue Nov 26, 2023 · 1 comment
Open
Labels
hacktoberfest scope: Camunda 8 Required in the context of Camunda 8 type: bug

Comments

@till-stadtler
Copy link
Contributor

till-stadtler commented Nov 26, 2023

Describe the bug
Date and time values can be specified by adding a time zone:

yyyy-MM-dd'T'HH:mm:ss+/-HH:mm 
yyyy-MM-dd'T'HH:mm:ss@ZoneId

These date and time values are comparable, as they describe unambiguous instants. This is reflected in the fact that the comparison does not result in null.

Here are examples of buggy behavior when comparing date and time values with time zones.

Using the same time zone via +01:00 and @Europe/Paris:

date and time("2023-03-06T16:23:00+01:00")
// returns: "2023-03-06T16:23:00+01:00"
date and time("2023-03-06T16:23:00@Europe/Paris")
// returns: "2023-03-06T16:23:00+01:00"

date and time("2023-03-06T16:23:00+01:00") = date and time("2023-03-06T16:23:00@Europe/Paris")
// returns: false
// expected: true
date and time("2023-03-06T16:23:00+01:00") < date and time("2023-03-06T16:23:00@Europe/Paris")
// returns: true
// expected: false

Using different time zones describing the same instant:

date and time("2023-03-06T16:23:00+01:00")
// returns: "2023-03-06T16:23:00+01:00"
date and time("2023-03-06T17:23:00+02:00")
// returns: "2023-03-06T17:23:00+02:00"

date and time("2023-03-06T16:23:00+01:00") = date and time("2023-03-06T17:23:00+02:00")
// returns: false
// expected: true
date and time("2023-03-06T16:23:00+01:00") < date and time("2023-03-06T17:23:00+02:00")
// returns: true
// expected: false

To Reproduce
Steps to reproduce the behavior:
Enter the expressions above in the FEEL Playground

Expected behavior
Comparing date and time values with the same time zones described via +01:00 and @Europe/Paris should return the correct values when compared.
Comparing date time time values with different time zones (+02:00/+01:00, or otherwise) should return the correct values when compared.

Environment

  • FEEL engine version: 1.17.3
  • Affects:
    • Zeebe: 8.3.3
@saig0
Copy link
Member

saig0 commented Dec 8, 2023

This issue is related to #560.

@saig0 saig0 changed the title Comparing date and time values with time zones is buggy Should compare date and time values with different time zones Dec 8, 2023
@saig0 saig0 added the scope: Camunda 8 Required in the context of Camunda 8 label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest scope: Camunda 8 Required in the context of Camunda 8 type: bug
Projects
None yet
Development

No branches or pull requests

2 participants