Skip to content

Commit

Permalink
Use fixed format string to serialize timestamp into query string when…
Browse files Browse the repository at this point in the history
… call Restore-AzCosmosDBTable
  • Loading branch information
msJinLei committed Oct 18, 2024
1 parent b7e7ab6 commit 16fa439
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/CosmosDB/CosmosDB/Table/RestoreAzCosmosDBTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using Microsoft.Azure.Commands.CosmosDB.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.CosmosDB.Models;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.Azure.Commands.CosmosDB.Helpers;
using Microsoft.Azure.Commands.CosmosDB.Exceptions;
using Microsoft.Rest.Azure;
Expand Down Expand Up @@ -170,7 +169,7 @@ public override void ExecuteCmdlet()

string accountInstanceId = databaseAccount.Name;

IEnumerable restorableTables = CosmosDBManagementClient.RestorableTables.ListWithHttpMessagesAsync(databaseAccount.Location, accountInstanceId, databaseAccount.CreationTime.ToString(), DateTime.MaxValue.ToString()).GetAwaiter().GetResult().Body;
IEnumerable restorableTables = CosmosDBManagementClient.RestorableTables.ListWithHttpMessagesAsync(databaseAccount.Location, accountInstanceId, databaseAccount.CreationTime?.ToString("M/dd/yyyy h:mm:ss tt"), DateTime.MaxValue.ToString("M/dd/yyyy h:mm:ss tt")).GetAwaiter().GetResult().Body;
(DateTime latestDatabaseDeleteTime, DateTime latestDatabaseCreateOrRecreateTime, string databaseRid) = ProcessRestorableDatabases(restorableTables);

if (databaseRid == null)
Expand Down

0 comments on commit 16fa439

Please sign in to comment.