DateTimeTimeExtension extension
Methods
-
clamp({DateTime? min, DateTime? max})
→ DateTime
-
Returns this DateTime clamped to be in the range
min
-max
.
-
copyWith({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond})
→ DateTime
-
-
isAtSameDayAs(DateTime other)
→ bool
-
Returns true if
other
is on the same day as this
.
-
isAtSameHourAs(DateTime other)
→ bool
-
Returns true if
other
is at the same hour as this
.
-
isAtSameMicrosecondAs(DateTime other)
→ bool
-
Returns true if
other
is at the same microsecond as this
.
-
isAtSameMillisecondAs(DateTime other)
→ bool
-
Returns true if
other
is at the same millisecond as this
.
-
isAtSameMinuteAs(DateTime other)
→ bool
-
Returns true if
other
is at the same minute as this
.
-
isAtSameMonthAs(DateTime other)
→ bool
-
Returns true if
other
is in the same month as this
.
-
isAtSameSecondAs(DateTime other)
→ bool
-
Returns true if
other
is at the same second as this
.
-
isAtSameYearAs(DateTime other)
→ bool
-
Returns true if
other
is in the same year as this
.
-
shift({int years = 0, int months = 0, int days = 0, int hours = 0, int minutes = 0, int seconds = 0, int milliseconds = 0, int microseconds = 0})
→ DateTime
-
Adds time units to the calendar date and/or clock time.
-
to(DateTime to, {Duration by = const Duration(days: 1)})
→ Iterable<DateTime>
-
Returns a range of dates to
to
, exclusive start, inclusive end
Operators
-
operator +(Duration duration)
→ DateTime
-
Adds this DateTime and Duration and returns the sum as a new DateTime object.
-
operator -(Duration duration)
→ DateTime
-
Subtracts the Duration from this DateTime returns the difference as a new DateTime object.