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

RangeIonTimestamp ignores precision when comparing timestamps #165

Open
zslayton opened this issue Feb 17, 2021 · 0 comments
Open

RangeIonTimestamp ignores precision when comparing timestamps #165

zslayton opened this issue Feb 17, 2021 · 0 comments

Comments

@zslayton
Copy link

When constructing a range of IonTimestamps, we currently convert the input IonTimestamp values to a BigDecimal number of milliseconds since the epoch using IonTimestamp#getDecimalMillis:

https://github.com/amzn/ion-schema-kotlin/blob/cde794e69206504227c8526580c28a56dedf18db/src/com/amazon/ionschema/internal/util/RangeIonTimestamp.kt#L39-L47

This means that we erroneously allow before/after comparisons of timestamps with mixed precision. For example, we consider 2007-06-01T12:46 to be after 2007-06-01T, which we cannot definitively conclude.

We will also ignore precisions greater than milliseconds, considering 2007-06-01T12:46:00.000111 and 2007-06-01T12:46:00.000444 to be equivalent.

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

No branches or pull requests

1 participant