Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.27 KB

README.md

File metadata and controls

29 lines (21 loc) · 1.27 KB

C# time

build release NuGet

What is AceCSharp.Time

It's a library, that exposes DI-ready and mockable implementation of current date and time, or date and time with offset.

Usage

IDateTimeProvider dateTimeProvider = new DateTimeProvider();

DateTime moment = dateTimeProvider.Now();
DateTime momentInUtc = dateTimeProvider.UtcNow();

DateTimeOffset momentWithOffset = dateTimeProvider.NowOffset();
DateTimeOffset momentWithZeroOffset = dateTimeProvider.UtcNowOffset();
ISystemTime systemTime = new SystemTime();

DateTime moment = systemTime.Now();
DateTime momentInUtc = systemTime.UtcNow();

License

AceCSharp.Time is Copyright © 2022 Dimitrie Tataru and other contributors under the MIT license.