Dart API Referencedart:coreDuration

Duration Interface

A Duration represents a time span. A duration can be negative.

Default class

DurationImplementation

Extends

Comparable

Implemented by

DurationImplementation

Constructors

Code const Duration([int days, int hours, int minutes, int seconds, int milliseconds]) #

The duration is the sum of all individual parts. This means that individual parts don't need to be less than the next-bigger unit. For example hours is allowed to have a value greater than 23.

All individual parts are allowed to be negative. All arguments are by default 0.

const Duration([int days, int hours, int minutes, int seconds,
                int milliseconds]);

Static Fields

Code final int HOURS_PER_DAY #

static final int HOURS_PER_DAY = 24;

Code final int MILLISECONDS_PER_DAY #

static final int MILLISECONDS_PER_DAY =
    MILLISECONDS_PER_HOUR * HOURS_PER_DAY;

Code final int MILLISECONDS_PER_HOUR #

static final int MILLISECONDS_PER_HOUR =
    MILLISECONDS_PER_MINUTE * MINUTES_PER_HOUR;

Code final int MILLISECONDS_PER_MINUTE #

static final int MILLISECONDS_PER_MINUTE =
    MILLISECONDS_PER_SECOND * SECONDS_PER_MINUTE;

Code final int MILLISECONDS_PER_SECOND #

static final int MILLISECONDS_PER_SECOND = 1000;

Code final int MINUTES_PER_DAY #

static final int MINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY;

Code final int MINUTES_PER_HOUR #

static final int MINUTES_PER_HOUR = 60;

Code final int SECONDS_PER_DAY #

static final int SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY;

Code final int SECONDS_PER_HOUR #

static final int SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR;

Code final int SECONDS_PER_MINUTE #

static final int SECONDS_PER_MINUTE = 60;

Fields

Code final int inDays #

Returns this Duration in days. Incomplete days are discarded.

final int inDays;

Code final int inHours #

Returns this Duration in hours. Incomplete hours are discarded. The returned value can be greater than 23.

final int inHours;

Code final int inMilliseconds #

Returns this Duration in milliseconds.

final int inMilliseconds;

Code final int inMinutes #

Returns this Duration in minutes. Incomplete minutes are discarded. The returned value can be greater than 59.

final int inMinutes;

Code final int inSeconds #

Returns this Duration in seconds. Incomplete seconds are discarded. The returned value can be greater than 59.

final int inSeconds;