Represents a clock which can return the current time as an Instant.
|C#||Visual Basic||Visual C++|
public interface IClock
Public Interface IClock
public interface class IClock
SystemClock.Instance.Now directly, in the same way as you might call UtcNow, it's strongly discouraged as a matter of style for production code. We recommend providing an instance of to anything that needs it, which allows you to write tests using the fake clock in the NodaTime.Testing assembly (or your own implementation).is intended for use anywhere you need to have access to the current time. Although it's not strictly incorrect to call
All implementations in Noda Time are thread-safe; custom implementations should be thread-safe too. See the thread safety section of the user guide for more information.
Assembly: NodaTime (Module: NodaTime.dll) Version: 18.104.22.168 (1.1.1)