DurationUnit enum
Does not take account for timezone
Constructors
- DurationUnit(int value, int microseconds)
-
const
Values
- microsecond → const DurationUnit
-
A microsecond equals a millionth of a second.
Smallest unit we have in Duration
const DurationUnit(0, 1)
- millisecond → const DurationUnit
-
A second equals Duration.microsecondsPerMillisecond microseconds
const DurationUnit(1, Duration.microsecondsPerMillisecond)
- second → const DurationUnit
-
A second equals Duration.millisecondsPerSecond milliseconds
const DurationUnit(2, Duration.microsecondsPerSecond)
- minute → const DurationUnit
-
An hour equals Duration.secondsPerMinute minutes
No leap seconds
const DurationUnit(3, Duration.microsecondsPerMinute)
- hour → const DurationUnit
-
An hour equals Duration.minutesPerHour minutes
const DurationUnit(4, Duration.microsecondsPerHour)
- day → const DurationUnit
-
A day equals Duration.hoursPerDay hours
Timezone is NOT taken into account
const DurationUnit(5, Duration.microsecondsPerDay)
- week → const DurationUnit
-
A week equals DurationExtra.daysPerWeek days
Timezone is NOT taken into account
const DurationUnit(6, DurationExtra.daysPerWeek * Duration.microsecondsPerDay)
- month → const DurationUnit
-
A month equals DurationExtra.daysPerMonth days
Timezone is NOT taken into account
const DurationUnit(7, DurationExtra.daysPerMonth * Duration.microsecondsPerDay)
- year → const DurationUnit
-
A year equals DurationExtra.daysPerYear days
Timezone is NOT taken into account
const DurationUnit(8, DurationExtra.daysPerYear * Duration.microsecondsPerDay)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- microseconds → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → int
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
relativeDuration(
Duration duration, DurationUnit unit) → int -
Returns rounded unit in specified
unit
Constants
-
values
→ const List<
DurationUnit> - A constant List of the values in this enum, in order of their declaration.