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

0.5: Add a LocalOffset type #1563

Open
pitdicker opened this issue Apr 7, 2024 · 4 comments
Open

0.5: Add a LocalOffset type #1563

pitdicker opened this issue Apr 7, 2024 · 4 comments

Comments

@pitdicker
Copy link
Collaborator

Currently the type returned for DateTimes with a Local time zone is a FixedOffset. This makes it impossible to add information to the DateTime such as the time zone name, abbreviation, or DST status.

For 0.5 we should instead return a LocalOffset type. That will allow us to expose more information in the future.

@pitdicker

This comment was marked as off-topic.

@pitdicker

This comment was marked as off-topic.

@djc
Copy link
Member

djc commented Apr 10, 2024

Appreciate all the research into this!

At the same time, I'm wary of adding substantial complexity to chrono on account of a tiny majority of use cases. Correctness and precision are not exactly the same thing, and it feels to me like you're chasing a level of precision here the requirement for which might be extremely rare, and, as such, not a great fit for a general purpose library such as chrono.

The only blocker here for 0.5 seems to be that we have a separate type LocalOffset which can expose more information. We could also seal the Offset trait so that we can more easily add functions to it later.

@pitdicker
Copy link
Collaborator Author

Sorry, replied in the wrong issue. Yes, I would only like to see a LocalOffset with nothing else for 0.5. The rest would not be a breaking change.

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

2 participants