Duration

Represents a temporal amount which captures the difference in time between two instants. Duration is defined with months, days, seconds, and nanoseconds. Note: Duration can be negative. Uses a core.time.Duration internally.

Constructors

this
this(Duration other)

Create a shallow copy of other Duration.

this
this(Value value)

Create a duration from a Value.

this
this(mg_duration* ptr)

Create a Duration using the given mg_duration.

Alias This

duration_

Members

Functions

days
auto days()

Returns the days part of the temporal amount.

months
auto months()

Returns the months part of the temporal amount.

nanoseconds
auto nanoseconds()

Returns the nanoseconds part of the temporal amount.

ptr
auto ptr()

Return pointer to internal mg_duration.

seconds
auto seconds()

Returns the seconds part of the temporal amount.

toString
string toString()

Return a printable string representation of this duration.

Meta