DateTimeExtensions extension
Extensions for DateTime
- on
Properties
- endOfDay → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Returns a new DateTime with the time set to the end of the day (23:59:59.999).no setter - endOfMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Returns a new DateTime with the time set to the end of the month.no setter - isAm → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
Check if the time is AMno setter - isInTheFuture → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the futureno setter - isInThePast → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the pastno setter - isInThisMonth → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the same month as the givendateno setter - isInThisYear → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the same year as the givendateno setter - isLeapYear → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
returns true if date year is leap yearno setter - isToday → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is todayno setter - isTomorrow → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is tomorrowno setter - isYesterday → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is yesterdayno setter - nextDay → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Return new instance of DateTime with the next day dateno setter - nextMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Return new instance of DateTime with the next month dateno setter - previousDay → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Return new instance of DateTime with the previous day dateno setter - previousMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Return new instance of DateTime with the previous month dateno setter - sameDayNextWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Return new instance of DateTime with the next week dateno setter - sameDayPreviousWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Return new instance of DateTime with the previous week dateno setter - startOfDay → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Returns a new DateTime with the time set to the start of the day (00:00:00.000). This is functionally equivalent to withoutTime.no setter - startOfMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtensions extension
Returns a new DateTime with the time set to the start of the month.no setter
Methods
-
copyWith(
{int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond}) → DateTime -
Available on DateTime, provided by the DateTimeExtensions extension
Creates new instance of DateTime with the same date But overrides the values of the given parameters -
dayOfTheWeek(
) → Weekday -
Available on DateTime, provided by the DateTimeExtensions extension
Returns the day of the week -
dayOfTheWeekIndex(
{Weekday firstDay = Weekday.monday}) → int -
Available on DateTime, provided by the DateTimeExtensions extension
Returns the index of the day of the week With the givenfirstDayas the first day of the week -
endOfWeek(
{Weekday firstDay = Weekday.monday}) → DateTime -
Available on DateTime, provided by the DateTimeExtensions extension
Returns a new DateTime with the time set to the end of the week. -
isInThisWeek(
{Weekday firstDay = Weekday.monday}) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the same week as the givendate -
isSameDay(
DateTime date) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the same day as the givendate -
isSameMonth(
DateTime date) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the same month as the givendate -
isSameWeek(
{required DateTime date, Weekday firstDay = Weekday.monday}) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the same week as the givendate -
isSameYear(
DateTime date) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Checks whether the date is in the same year as the givendate -
monthOfTheYear(
) → Month -
Available on DateTime, provided by the DateTimeExtensions extension
Returns the month of the given date. -
startOfWeek(
{Weekday firstDay = Weekday.monday}) → DateTime -
Available on DateTime, provided by the DateTimeExtensions extension
Returns a new DateTime with the time set to the start of the week. -
withoutTime(
) → DateTime -
Available on DateTime, provided by the DateTimeExtensions extension
Returns new DateTime without the time part for example =>2020-01-01T12:51:42.325to =>2020-01-01T00:00:00.000