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

[core] Add DateTimeType method for returning Instant #3287

Merged
merged 1 commit into from
Dec 30, 2022

Conversation

jlaur
Copy link
Contributor

@jlaur jlaur commented Dec 30, 2022

Wish from forum post:

In relation to #2898 the plan would be to internally switch from ZonedDateTime to Instant while preserving backwards compatibility. This means getZonedDateTime() will stay, but it will eventually be changed to return a ZonedDateTime with the currently configured time-zone based on the internal Instant.

Therefore it would only be natural to also add a method for returning the Instant representation of the current object. This does not need to wait for the additional refactoring as it will provide user value right away, but implementation will of course change when we figure out how to make TimeZoneProvider accessible from DateTimeType.

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur jlaur requested a review from a team as a code owner December 30, 2022 16:12
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-4-0-wishlist/142388/109

@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Dec 30, 2022
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

LGTM.

@J-N-K J-N-K merged commit 100aa6e into openhab:main Dec 30, 2022
@jlaur jlaur deleted the 2898-datetimetype-get-instant branch December 30, 2022 19:56
@wborn wborn added this to the 4.0 milestone Dec 30, 2022
@mhilbush
Copy link
Contributor

Thank you @jlaur !

@jlaur jlaur changed the title [core] Add DateTimeType method for returning Instant [core] Add DateTimeType method for returning Instant Mar 10, 2023
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
GitOrigin-RevId: 100aa6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants