SplitScript reference / Duration / fromDays

Duration.fromDays

Function

Duration.fromDays<T>(days: T) -> Duration where T: Numeric

Constructs a duration from days.

Every integer and floating-point type is accepted. A day is exactly 86,400 seconds; calendar and time-zone rules are intentionally not involved.

Parameters

  • days: The number of elapsed 24-hour days.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Construct a multi-day sentinel

let sentinel = Duration.fromDays(2.0)