Table of Contents

Class BusinessClock

Namespace
Integrations.Application.Common
Assembly
Integrations.Application.dll

Business time: timestamps and business dates ("today") in PVC's time zone rather than UTC, so a 9pm Eastern commit is still today. Uses its own keyed TimeProvider so tests can move business time without also freezing infrastructure timers (HTTP retries, timeouts).

public sealed class BusinessClock
Inheritance
BusinessClock
Inherited Members

Constructors

BusinessClock(TimeProvider, IOptions<FxOptions>)

Business time: timestamps and business dates ("today") in PVC's time zone rather than UTC, so a 9pm Eastern commit is still today. Uses its own keyed TimeProvider so tests can move business time without also freezing infrastructure timers (HTTP retries, timeouts).

public BusinessClock(TimeProvider time, IOptions<FxOptions> options)

Parameters

time TimeProvider
options IOptions<FxOptions>

Fields

TimeKey

Keyed-service key for the TimeProvider the clock uses.

public const string TimeKey = "business"

Field Value

string

Properties

Now

Current instant (UTC).

public DateTimeOffset Now { get; }

Property Value

DateTimeOffset

Today

Today's date in the business time zone (the default document and rate date).

public DateOnly Today { get; }

Property Value

DateOnly

Methods

At(DateOnly, TimeOnly)

The instant a business-time-zone wall-clock time happens on a date (e.g. 03:00 New York). A time skipped by a daylight-saving change moves forward by the gap; an ambiguous one takes the first occurrence.

public DateTimeOffset At(DateOnly date, TimeOnly time)

Parameters

date DateOnly

Business date.

time TimeOnly

Wall-clock time in the business time zone.

Returns

DateTimeOffset

The instant, in UTC.