Class SystemClock
Singleton implementation of IClock which reads the current system time.
It is recommended that for anything other than throwaway code, this is only referenced
in a single place in your code: where you provide a value to inject into the rest of
your application, which should only depend on the interface.
Since 1.0.x
Availability net35-Client, PCL
Inheritance
Object
SystemClock
Implements
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: NodaTime
Assembly: NodaTime.dll
Syntax
public sealed class SystemClock : IClock
Fields
Instance
The singleton instance of SystemClock.
Since 1.0.x
Availability net35-Client, PCL
Declaration
public static readonly SystemClock Instance
Field Value
Type | Description |
---|---|
SystemClock | The singleton instance of SystemClock. |
Properties
Now
Gets the current time as an Instant.
Since 1.0.x
Availability net35-Client, PCL
Declaration
public Instant Now { get; }
Property Value
Type | Description |
---|---|
Instant | The current time in ticks as an Instant. |