Time class

A unit of measurement representing time.

Inheritance

Constructors

Time.fromCentiseconds(Rational centiseconds)
Creates a Time representing the specified number of centiseconds.
factory
Time.fromCenturies(Rational centuries)
Creates a Time representing the specified number of centuries.
factory
Time.fromDays(Rational days)
Creates a Time representing the specified number of days.
factory
Time.fromDecades(Rational decades)
Creates a Time representing the specified number of decades.
factory
Time.fromDecaseconds(Rational decaseconds)
Creates a Time representing the specified number of decaseconds.
factory
Time.fromDeciseconds(Rational deciseconds)
Creates a Time representing the specified number of deciseconds.
factory
Time.fromFortnights(Rational fortnights)
Creates a Time representing the specified number of fortnights.
factory
Time.fromHours(Rational hours)
Creates a Time representing the specified number of hours.
factory
Time.fromMicroseconds(Rational microseconds)
Creates a Time representing the specified number of microseconds.
factory
Time.fromMilliseconds(Rational milliseconds)
Creates a Time representing the specified number of milliseconds.
factory
Time.fromMinutes(Rational minutes)
Creates a Time representing the specified number of minutes.
factory
Time.fromMonths(Rational months)
Creates a Time representing the specified number of months.
factory
Time.fromNanoseconds(Rational nanoseconds)
Creates a Time representing the specified number of nanoseconds.
factory
Time.fromQuarters(Rational quarters)
Creates a Time representing the specified number of quarters.
factory
Time.fromSeconds(Rational seconds)
Creates a Time representing the specified number of seconds.
factory
Time.fromUnits(TimeUnit unit, Rational value)
Creates a Time given a unit and rational value for that unit.
Time.fromWeeks(Rational weeks)
Creates a Time representing the specified number of weeks.
factory
Time.fromYears(Rational years)
Creates a Time representing the specified number of years.
factory

Properties

baseValue ↔ Rational
The underlying base value of the unit of measurement.
latefinalinherited
centiseconds → Rational
Gets the number of centiseconds in this Time, including any fractional portion.
no setter
centuries → Rational
Gets the number of centuries in this Time, including any fractional portion.
no setter
days → Rational
Gets the number of days in this Time, including any fractional portion.
no setter
decades → Rational
Gets the number of decades in this Time, including any fractional portion.
no setter
decaseconds → Rational
Gets the number of decaseconds in this Time, including any fractional portion.
no setter
deciseconds → Rational
Gets the number of deciseconds in this Time, including any fractional portion.
no setter
fortnights → Rational
Gets the number of fortnights in this Time, including any fractional portion.
no setter
hashCode int
The hash code for this object.
no setterinherited
hours → Rational
Gets the number of hours in this Time, including any fractional portion.
no setter
microseconds → Rational
Gets the number of microseconds in this Time, including any fractional portion.
no setter
milliseconds → Rational
Gets the number of milliseconds in this Time, including any fractional portion.
no setter
minutes → Rational
Gets the number of minutes in this Time, including any fractional portion.
no setter
months → Rational
Gets the number of months in this Time, including any fractional portion.
no setter
nanoseconds → Rational
Gets the number of nanoseconds in this Time, including any fractional portion.
no setter
quarters → Rational
Gets the number of quarters in this Time, including any fractional portion.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seconds → Rational
Gets the number of seconds in this Time, including any fractional portion.
no setter
weeks → Rational
Gets the number of weeks in this Time, including any fractional portion.
no setter
years → Rational
Gets the number of years in this Time, including any fractional portion.
no setter

Methods

abs() Time
Gets the absolute value.
inherited
compareTo(Time other) int
Compares this object to another object.
inherited
createValue(Rational baseValue) Time
Creates a unit of measurement value with the specified baseValue.
override
getBaseValue(TimeUnit unit, Rational value) → Rational
Gets the base value for a unit of measurement of unit and value.
override
getLargestUnit({required Set<TimeUnit> permissibleUnits}) TimeUnit
Determines the largest unit that has a value of at least 1.
inherited
getUnits(TimeUnit unit) → Rational
Gets the number of unit units in this unit of measurement.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
per(Duration period) TimeRate
Creates a TimeRate with the specified period from this value.
round(TimeUnit roundTo) Time
Rounds this unit of measurement such that the roundTo unit will be rounded towards the nearest integer.
inherited
toString() String
A string representation of this object.
override

Operators

operator *(Rational factor) Time
Multiplies this value by factor.
inherited
operator +(Time other) Time
Adds other onto this value.
inherited
operator -(Time other) Time
Subtracts other from this value.
inherited
operator /(Rational divisor) Time
Divides this value by divisor.
inherited
operator <(Time other) bool
Determines whether this value is less than other.
inherited
operator <=(Time other) bool
Determines whether this value is less than or equal to other.
inherited
operator ==(Object other) bool
Determines whether this unit of measurement value is equal to other.
inherited
operator >(Time other) bool
Determines whether this value is greater than other.
inherited
operator >=(Time other) bool
Determines whether this value is greater than or equal to other.
inherited
operator unary-() Time
Negates this value.
inherited

Static Properties

zero Time
A Time of zero duration.
final