-
Notifications
You must be signed in to change notification settings - Fork 381
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
Fix issue with $localDatetime using UTC. #3626
Conversation
Can you provide a test to pin the expected behavior? |
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. |
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. |
Fixes WebTools AZDo issue 2187534