Table of Contents

Class Epoch

Namespace
MassiveDotNet
Assembly
MassiveDotNet.dll

Converts the raw epoch values wire DTOs store into instants, at the precision each wire field carries.

public static class Epoch
Inheritance
Epoch
Inherited Members

Remarks

Models store the epoch value as a long and compute the Instant only when read (decision D5), so this is called from computed properties, never at deserialization. Nanosecond precision is kept: Instant resolves to the nanosecond and a Duration built from nanoseconds loses nothing, whereas FromUnixTimeTicks(long) would truncate to 100 ns. It lives in core because both the REST and WebSocket packages read wire epochs, and the two units do not agree: REST v3 sends nanoseconds where the streaming wire sends milliseconds for the same conceptual field (D-W11).

Methods

FromMilliseconds(long)

Converts Unix milliseconds, the unit of aggregate, indicator, and streaming timestamps.

public static Instant FromMilliseconds(long milliseconds)

Parameters

milliseconds long

Milliseconds since the Unix epoch.

Returns

Instant

The instant.

FromNanoseconds(long)

Converts Unix nanoseconds, the unit of every REST tick-level timestamp.

public static Instant FromNanoseconds(long nanoseconds)

Parameters

nanoseconds long

Nanoseconds since the Unix epoch.

Returns

Instant

The instant, to the nanosecond.