-
Notifications
You must be signed in to change notification settings - Fork 4.1k
{WebApp} fix the not recognized as a valid DateTime error #17260
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
Conversation
This conversion to localtime should fix the conversion issue due to localization format
|
Hi @navba-MSFT, have you figure out the root cause of this issue? I would like to suggest you to fix this issue by |
Fix for the DateTime.Parse(s.Time) to address the localization issue and avoid the error String was not recognized as a valid DateTime
|
Hi @navba-MSFT , a test case is failed, please have a look. [xUnit.net 00:01:00.29] Microsoft.Azure.Commands.Websites.Test.ScenarioTests.CertificatesTests.TestNewAzWebAppCertificateForSlot [FAIL] |
|
/azp run azure-powershell - windows-powershell |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/AZP RUN azure-powershell - security-tools |
|
Azure Pipelines successfully started running 1 pipeline(s). |
BethanyZhou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@BethanyZhou Thanks for reviewing this. Could you merge this once you get a chance ? |
|
/azp run azure-powershell - security-tools |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Sure, I will merge it when the CI passed. @navba-MSFT |
This conversion to localtime should fix the conversion issue due to localization format
Description
Checklist
I have read the Submitting Changes section of
CONTRIBUTING.mdThe title of the PR is clear and informative
The appropriate
ChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be addedThe PR does not introduce breaking changes
If applicable, the changes made in the PR have proper test coverage
For public API changes to cmdlets:
More Info:
When running the cmdlet with non en-US (at least, in pl-PL culture) the cmdlet fails with example error:
String '01/24/2022 22:52:39' was not recognized as a valid DateTime.
Output of:
[system.threading.thread]::CurrentThread.CurrentCulture
LCID Name DisplayName
1045 pl-PL Polish (Poland)
Steps to reproduce:
[system.threading.thread]::CurrentThread.CurrentCulture = [System.Globalization.CultureInfo]::GetCultureInfo("pl-PL")
Get-AzWebAppSnapshot -ResourceGroupName $SourceRG -Name $WebAppName
This fails with the error: String '01/24/2022 22:52:39' was not recognized as a valid DateTime.