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

Separated Time unit into TimeDelta and TimeStamp #243

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

Conversation

T0mexX
Copy link
Contributor

@T0mexX T0mexX commented Aug 23, 2024

Summary

Separated Time unit into TimeDelta and TimeStamp.

Implementation Notes ⚒️

Addition and subtruction between Timestamps is not allowed, but any
other Unit operation/comparison is. TimeDeltas can be
added/subtructed to/form Timestamps.

Deserialization of Timestamp:

  • Number -> interpreted as millis from Epoch
  • Instant (string representation) -> converted to Timestamp
  • Duration (string representation) -> interpreted as duration since
    Epoch (warn msg is logged)

Deserialization of TimeDelta is the same as Time was before, with the
difference that when an Instant is converted to a timedelta since Epoch
a warning message is logged.

External Dependencies 🍀

N/A

Breaking API Changes ⚠️

N/A

Addition and subtruction between `Timestamp`s is not allowed, but any
other `Unit` operation/comparison is. `TimeDelta`s can be
added/subtructed to/form `Timestamp`s.

Deserialization of `Timestamp`:
- `Number` -> interpreted as millis from Epoch
- `Instant` (string representation) -> converted to Timestamp
- `Duration` (string representation) -> interpreted as duration since
  Epoch (warn msg is logged)

Deserialization of `TimeDelta` is the same as `Time` was before, with the
diference that when an `Instant` is converted to an timedelta since Epoch
a warning message is logged.
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.

1 participant