DateTimeTimeExtension extension

on

Properties

date DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns only year, month and day
no setter
daysInMonth int

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns the amount of days that are in this month.
no setter
endOfDay DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns the last microsecond of the day (23:59:59.999999)
no setter
firstDayOfMonth DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns the first day of this month
no setter
firstDayOfWeek DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns the Monday of this week
no setter
firstDayOfYear DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns the first day of this year
no setter
isLeapYear bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns true if this year is a leap year.
no setter
isToday bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns if today, true
no setter
isTomorrow bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns if tomorrow, true
no setter
isWeekend bool

Available on DateTime, provided by the DateTimeTimeExtension extension

no setter
isWorkday bool

Available on DateTime, provided by the DateTimeTimeExtension extension

no setter
lastDayOfMonth DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns the last day of this month (considers leap years)
no setter
lastDayOfWeek DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns the Sunday of this week
no setter
lastDayOfYear DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns the last day of this year
no setter
timeOfDay Duration

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns only the time
no setter
wasYesterday bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns if yesterday, true
no setter

Methods

clamp({DateTime? min, DateTime? max}) DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

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

Available on DateTime, provided by the DateTimeTimeExtension extension

isAtSameDayAs(DateTime other) bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns true if other is on the same day as this.
isAtSameHourAs(DateTime other) bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns true if other is at the same hour as this.
isAtSameMicrosecondAs(DateTime other) bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns true if other is at the same microsecond as this.
isAtSameMillisecondAs(DateTime other) bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns true if other is at the same millisecond as this.
isAtSameMinuteAs(DateTime other) bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns true if other is at the same minute as this.
isAtSameMonthAs(DateTime other) bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns true if other is in the same month as this.
isAtSameSecondAs(DateTime other) bool

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns true if other is at the same second as this.
isAtSameYearAs(DateTime other) bool

Available on DateTime, provided by the DateTimeTimeExtension extension

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

Available on DateTime, provided by the DateTimeTimeExtension extension

Adds time units to the calendar date and/or clock time.
to(DateTime to, {Duration by = const Duration(days: 1)}) Iterable<DateTime>

Available on DateTime, provided by the DateTimeTimeExtension extension

Returns a range of dates to to, exclusive start, inclusive end

Operators

operator +(Duration duration) DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Adds this DateTime and Duration and returns the sum as a new DateTime object.
operator -(Duration duration) DateTime

Available on DateTime, provided by the DateTimeTimeExtension extension

Subtracts the Duration from this DateTime returns the difference as a new DateTime object.