nanosToUnit

fnlong nanosToUnit(long nanos, TemporalUnit unit) @safe pure

Scales a nanosecond count to unit, exactly (checked).

Division is toward zero, as integer division in D is; a nonzero remainder in either sign refuses.

Parameters

nanosthe value in nanoseconds (signed).
unitthe unit to express it in.

Returns

The equivalent count in unit.

Throws

DateTimeException when a sub-unit remainder would be lost - use

nanosToUnitTruncated for explicit loss - or when the result does not fit a signed 64-bit integer.