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 issue with $localDatetime using UTC. #3626

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

phenning
Copy link
Contributor

@phenning phenning commented Aug 5, 2024

Fixes WebTools AZDo issue 2187534

@phenning
Copy link
Contributor Author

phenning commented Aug 5, 2024

@jonsequitur
Copy link
Contributor

Can you provide a test to pin the expected behavior?

@phenning
Copy link
Contributor Author

phenning commented Aug 5, 2024

Sure it looks like we already have some that were added in a previous PR, but didn’t use the full time likely due to not being able to get an accurate asset time, so we were hiding this bug.

I’ll update the test to at least consider the hour in the format string that should reduce the likelihood of random failures as opposed to using a full datetime.

https://github.com/dotnet/interactive/pull/3505/files

@phenning
Copy link
Contributor Author

phenning commented Aug 6, 2024

Can you provide a test to pin the expected behavior?

Added two new tests which just verify that we are using the correct timezone, added comment in tests to explain slightly different usage then other unit tests - in other tests we pass in a delegate which replaces the default product behavior so that we can match the actual time in the assertions. For this test, we don't call that overload so that we get the actual product behavior and the real GetDateTimeOffset method is called which returns either Now or UtcNow depending on the isLocal argument.

@jonsequitur jonsequitur enabled auto-merge (squash) August 6, 2024 17:19
@jonsequitur jonsequitur merged commit a86ea33 into dotnet:main Aug 6, 2024
4 checks passed
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.

2 participants