diff --git a/src/Testcontainers/Clients/DockerContainerOperations.cs b/src/Testcontainers/Clients/DockerContainerOperations.cs index 33d7e7d9e..aee7e39b1 100644 --- a/src/Testcontainers/Clients/DockerContainerOperations.cs +++ b/src/Testcontainers/Clients/DockerContainerOperations.cs @@ -69,8 +69,8 @@ public async Task GetExitCodeAsync(string id, CancellationToken ct = defau { ShowStdout = true, ShowStderr = true, - Since = since.TotalSeconds.ToString("0", CultureInfo.InvariantCulture), - Until = until.TotalSeconds.ToString("0", CultureInfo.InvariantCulture), + Since = Math.Max(0, since.TotalSeconds).ToString("0", CultureInfo.InvariantCulture), + Until = Math.Max(0, until.TotalSeconds).ToString("0", CultureInfo.InvariantCulture), Timestamps = timestampsEnabled, }; diff --git a/src/Testcontainers/Clients/TestcontainersClient.cs b/src/Testcontainers/Clients/TestcontainersClient.cs index e122610d4..2714bb0a6 100644 --- a/src/Testcontainers/Clients/TestcontainersClient.cs +++ b/src/Testcontainers/Clients/TestcontainersClient.cs @@ -106,12 +106,12 @@ public Task GetContainerExitCodeAsync(string id, CancellationToken ct = de if (default(DateTime).Equals(since)) { - since = DateTime.MinValue; + since = unixEpoch; } if (default(DateTime).Equals(until)) { - until = DateTime.MaxValue; + until = unixEpoch; } return Container.GetLogsAsync(id, since.ToUniversalTime().Subtract(unixEpoch), until.ToUniversalTime().Subtract(unixEpoch), timestampsEnabled, ct);