From f5a44ad9632bc04914de9c218a05573fb2adcdf2 Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Thu, 24 Feb 2022 14:12:06 +0530 Subject: [PATCH 1/4] {WebApp} fix the not recognized as a valid DateTime error This conversion to localtime should fix the conversion issue due to localization format --- .../Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Websites/Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs b/src/Websites/Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs index 989140f2c4ee..369094ce287e 100644 --- a/src/Websites/Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs +++ b/src/Websites/Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs @@ -34,7 +34,7 @@ public override void ExecuteCmdlet() ResourceGroupName = this.ResourceGroupName, Name = this.Name, Slot = string.IsNullOrEmpty(this.Slot) ? "Production" : this.Slot, - SnapshotTime = DateTime.Parse(s.Time) + SnapshotTime = DateTime.Parse(s.Time).ToLocalTime() }; }).OrderByDescending(s => s.SnapshotTime).ToArray(); WriteObject(list, true); From fae68c7f52dfec3b5ff4cd1a5adc24367f76e49b Mon Sep 17 00:00:00 2001 From: navba-MSFT <57353862+navba-MSFT@users.noreply.github.com> Date: Thu, 24 Feb 2022 15:28:03 +0530 Subject: [PATCH 2/4] Fix for the DateTime.Parse(s.Time) to address the localization issue Fix for the DateTime.Parse(s.Time) to address the localization issue and avoid the error String was not recognized as a valid DateTime --- .../Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Websites/Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs b/src/Websites/Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs index 369094ce287e..8b2d2d907002 100644 --- a/src/Websites/Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs +++ b/src/Websites/Websites/Cmdlets/BackupRestore/GetAzureWebAppSnapshot.cs @@ -15,6 +15,7 @@ using System; using System.Linq; using System.Management.Automation; +using System.Globalization; namespace Microsoft.Azure.Commands.WebApps.Cmdlets.BackupRestore { @@ -34,7 +35,7 @@ public override void ExecuteCmdlet() ResourceGroupName = this.ResourceGroupName, Name = this.Name, Slot = string.IsNullOrEmpty(this.Slot) ? "Production" : this.Slot, - SnapshotTime = DateTime.Parse(s.Time).ToLocalTime() + SnapshotTime = DateTime.Parse(s.Time, CultureInfo.InvariantCulture) }; }).OrderByDescending(s => s.SnapshotTime).ToArray(); WriteObject(list, true); From eaec76a37cb0e87d64c34be4702f7bcd7b3772a0 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Tue, 1 Mar 2022 14:19:42 +0800 Subject: [PATCH 3/4] Update ChangeLog.md --- src/Websites/Websites/ChangeLog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Websites/Websites/ChangeLog.md b/src/Websites/Websites/ChangeLog.md index f6074198074e..146ad2f7f2b5 100644 --- a/src/Websites/Websites/ChangeLog.md +++ b/src/Websites/Websites/ChangeLog.md @@ -18,7 +18,8 @@ - Additional information about change #1 --> ## Upcoming Release - +* Fixed DateTime conversion issue caused by culture +* ## Version 2.10.0 * Updated `New-AzAppServicePlan` to create an app service plan with host environment id #16094 From ba2ad07736af63ecc589dc12cdfde66ee5f661cb Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Tue, 1 Mar 2022 14:19:51 +0800 Subject: [PATCH 4/4] Update ChangeLog.md --- src/Websites/Websites/ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Websites/Websites/ChangeLog.md b/src/Websites/Websites/ChangeLog.md index 146ad2f7f2b5..9f7a68670611 100644 --- a/src/Websites/Websites/ChangeLog.md +++ b/src/Websites/Websites/ChangeLog.md @@ -19,7 +19,7 @@ --> ## Upcoming Release * Fixed DateTime conversion issue caused by culture -* + ## Version 2.10.0 * Updated `New-AzAppServicePlan` to create an app service plan with host environment id #16094