Duration¶
Import: import system;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
Duration¶
A signed span of time with millisecond precision. Add one to a DateTime with DateTime.add, or combine durations with add and sub.
millis¶
Length of the span in milliseconds; negative values point backward in time.
constructor¶
Creates a duration of millis milliseconds.
from_seconds¶
Creates a duration of seconds whole seconds.
from_minutes¶
Creates a duration of minutes whole minutes.
from_hours¶
Creates a duration of hours whole hours.
from_days¶
Creates a duration of days 24-hour days. Calendar days that cross a daylight-saving change are not adjusted.
as_seconds¶
Returns the duration in whole seconds, truncated toward zero.
add¶
Returns the sum of this duration and other.
sub¶
Returns this duration minus other.