RealTime class
A class that contains methods for getting the current time.
Unlike the DateTime class, this class is immutable.
It's convenience class to manage time more easily.
Constructors
- RealTime({required int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0})
-
const
- RealTime.earliest([bool isNone = false])
-
const
- RealTime.epoch()
-
const
- RealTime.fromDateTime(DateTime dateTime)
- RealTime.latest()
-
const
- RealTime.none()
-
const
- RealTime.now()
-
Returns a DateTime object with the current time.
Always returns a new DateTime object.
const
Properties
- dateTime → DateTime
-
no setter
- day → int
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- hour → int
-
final
- isDefined → bool
-
Returns
trueif the object is defined.
Always check if the object is defined before using it.no setterinherited - isSabbath → bool
-
Returns
trueif the current day is Sabbath.
Sabbath is the seventh day of the week, which is Saturday.no setter - isUndefined → bool
-
Returns
trueif the object is undefined.
Always check if the object is undefined before using it.no setterinherited - microsecond → int
-
final
- millisecond → int
-
final
- minute → int
-
final
- month → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- second → int
-
final
- weekDay → WeekDay
-
Returns the current day of the week.
no setter
- year → 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.
override