Skip to content

Consider using TimeProvider using Microsoft.Bcl.TimeProvider nuget package #451

@JakeYallop

Description

@JakeYallop

There is a comment in ISystemClock here:

/// <summary>
/// Abstracts the system clock to facilitate testing.
/// .NET8 offers an abstract class TimeProvider. After we stop supporting .NET version less than .NET8, this ISystemClock should retire.
/// </summary>
internal interface ISystemClock
{
/// <summary>
/// Retrieves the current system time in UTC.
/// </summary>
public DateTimeOffset UtcNow { get; }

However this is not correct. The runtime provides a down-level package https://www.nuget.org/packages/Microsoft.Bcl.TimeProvider/ that allows TimeProvider to be used code using older versions of the runtime, or code that needs to support .NET standard.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions