Auf Englisch lesen

Freigeben über


FakeTimeProvider Constructors

Definition

Overloads

FakeTimeProvider()

Initializes a new instance of the FakeTimeProvider class.

FakeTimeProvider(DateTimeOffset)

Initializes a new instance of the FakeTimeProvider class.

FakeTimeProvider()

Source:
FakeTimeProvider.cs

Initializes a new instance of the FakeTimeProvider class.

C#
public FakeTimeProvider ();

Remarks

This creates a provider whose time is initially set to midnight January 1st 2000. The provider is set to not automatically advance time each time it is read.

Applies to

.NET 9 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)

FakeTimeProvider(DateTimeOffset)

Source:
FakeTimeProvider.cs

Initializes a new instance of the FakeTimeProvider class.

C#
public FakeTimeProvider (DateTimeOffset startDateTime);

Parameters

startDateTime
DateTimeOffset

The initial time and date reported by the provider.

Remarks

The provider is set to not automatically advance time each time it is read.

Applies to

.NET 9 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)