DateTimeTimeExtension extension

on

Properties

date DateTime
Returns only year, month and day
no setter
daysInMonth int
Returns the amount of days that are in this month.
no setter
isLeapYear bool
Returns true if this year is a leap year.
no setter
isToday bool
Returns if today, true
no setter
isTomorrow bool
Returns if tomorrow, true
no setter
timeOfDay Duration
Returns only the time
no setter
wasYesterday bool
Returns if yesterday, true
no setter

Methods

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.
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.