Skip to content

[fix-585] fixed the issue of not handle negative values when process the accuracy range of datetime #586

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IKAZUCHI-Akira
Copy link
Contributor

…e accuracy range of timestamp

Proposed changes

Issue Number: close #585

Problem Summary:

fixed the issue of not handling negative values when process the accuracy range of timestamp

Checklist(Required)

  1. Does it affect the original behavior: (Yes)
  2. Has unit tests been added: (No)
  3. Has document been added or modified: (No Need)
  4. Does it need to update dependencies: (No)
  5. Are there any changes that cannot be rolled back: (No)

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

instant = Instant.ofEpochSecond(time);
} else if (time < 10_000_000_000_000L) { // milli second
} else if (time > -10_000_000_000_000L && time < 10_000_000_000_000L) { // milli second
instant = Instant.ofEpochMilli(time);
} else { // micro second
instant = Instant.ofEpochSecond(time / 1_000_000, (time % 1_000_000) * 1_000);
Copy link
Member

Choose a reason for hiding this comment

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

It is better to add a case to cover the lower boundary value

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.

[Bug] not handle negative values when process the accuracy range of datetime
2 participants