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

Fix DateTimeOffset.DateTime UTC bug #7349

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

Arkatufus
Copy link
Contributor

Fixes https://github.com/akkadotnet/akka.net/blame/554086ccba07338194aca2a1eb8e0f9d801973b7/src/core/Akka.Persistence/Eventsourced.cs#L221

  1. It uses DateTimeOffset.Date which strips the time portion of the DateTime struct
  2. DateTimeOffset.DateTime returns a DateTime object with DateTimeKind.Unspecified and we need DateTimeKind.Utc

Changes

Add a new property in ITimeProvider interface that returns a DateTime.UtcNow

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) September 30, 2024 18:26
@Aaronontheweb Aaronontheweb merged commit 33fd92d into akkadotnet:dev Sep 30, 2024
9 of 12 checks passed
Arkatufus added a commit to Arkatufus/akka.net that referenced this pull request Oct 3, 2024
Aaronontheweb pushed a commit that referenced this pull request Oct 3, 2024
* Revert "Fix unit tests related to the Persistence DateTime bug (#7352)"

This reverts commit f5c4e63.

* Revert "Fix DateTimeOffset.DateTime UTC bug (#7349)"

This reverts commit 33fd92d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants