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.

Constructors

this
this(Duration other)

Create a 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.

this
this(mg_duration* ptr)

Create a Duration from a copy of the given mg_duration.

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

days
const(long) days()

Returns the days part of the temporal amount.

months
const(long) months()

Returns the months part of the temporal amount.

nanoseconds
const(long) nanoseconds()

Returns the nanoseconds part of the temporal amount.

opAssign
Duration opAssign(Duration rhs)

Assigns a duration to another. The target of the assignment gets detached from whatever duration it was attached to, and attaches itself to the new duration.

opEquals
bool opEquals(Duration other)

Compares this duration with other. Return: true if same, false otherwise.

ptr
const(mg_duration*) ptr()
Undocumented in source. Be warned that the author may not have intended to support it.
seconds
const(long) seconds()

Returns the seconds part of the temporal amount.

toString
const(string) toString()

Return a printable string representation of this duration.

Meta