Dotnet, Development, C Sharp Programming, Csharp, Microsoft.
specific period of the day will succeed. public interface IDateTimeOffsetProvider { DateTimeOffset UtcNow { get; } } public class DateTimeOffsetProvider : IDateTimeOffsetProvider { public DateTimeOffset UtcNow => DateTimeOffset.UtcNow; } And then use this wrapper via DI in your class: public class