Class LatitudePaySystemClock
Represents the default system clock used by the Yort.LatitudePay.Instore library to retrieve the current date and time.
Implements
Inherited Members
Namespace: Yort.LatitudePay.InStore
Assembly: Yort.LatitudePay.InStore.dll
Syntax
public sealed class LatitudePaySystemClock : ILatitudePaySystemClock
Remarks
This implementation simply wraps the Now property and relies on the underlying system clock for accuracy.
This class has a private constructor and cannot be created by user code. To obtain and instance use the static DefaultInstance property.
Properties
| Improve this Doc View SourceDefaultInstance
Returns an instance of this clock.
Declaration
public static LatitudePaySystemClock DefaultInstance { get; }
Property Value
Type | Description |
---|---|
LatitudePaySystemClock |
Remarks
The instance returned by this method is cached after the first call to reduce allocations, so all subsquent calls will receive the same shared instance. However the property is not thread-safe and two threads calling the method simultanously for the first time may receive different instances. This should not cause a problem as clients should not (and are instructed not to) compare instances or rely on shared instances.
Now
Returns the current date and time from the system clock.
Declaration
public DateTimeOffset Now { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |