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

Consider moving Instant and Clock to the standard library #382

Open
dkhalanskyjb opened this issue Apr 16, 2024 · 0 comments
Open

Consider moving Instant and Clock to the standard library #382

dkhalanskyjb opened this issue Apr 16, 2024 · 0 comments
Labels
breaking change This could break existing code
Milestone

Comments

@dkhalanskyjb
Copy link
Collaborator

Obtaining the current instant is often needed, as is doing some Duration-based operations on it. Instant is useful even when the rest of the library isn't: you don't need the timezone functionality to log human-readable timestamps (#121 (comment)) or represent file access and modification times (okio), or sort events, etc.

With this change, the kotlinx-datetime library would provide calendar- and timezone-aware operations, whereas Instant, Duration, Clock, and TimeSource would work with just "the flow of time" as seen by the computer.

  • The parsing and formatting facilities for Instant should probably stay in the kotlinx-datetime library, as they aren't very meaningful without the notion of a calendar.
  • InstantIso8601Serializer and InstantComponentSerializer would probably enter the kotlinx-serialization library in some form.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This could break existing code
Projects
None yet
Development

No branches or pull requests

1 participant