DateTimeBasics extension
Utility extension methods for the core DateTime class.
- on
Methods
-
addCalendarDays(
int numberOfDays) → DateTime -
Available on DateTime, provided by the DateTimeBasics extension
Adds a specified number of days to this DateTime. -
calendarDaysTill(
int year, int month, int day) → int -
Available on DateTime, provided by the DateTimeBasics extension
Returns the number of calendar days till the specified date. -
copyWith(
{int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) → DateTime -
Available on DateTime, provided by the DateTimeBasics extension
Copies a DateTime, overriding specified values. -
isAtOrAfter(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeBasics extension
Returns true ifthis
occurs at or afterother
, accounting for time zones. -
isAtOrBefore(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeBasics extension
Returns true ifthis
occurs at or beforeother
, accounting for time zones.
Operators
-
operator +(
Duration duration) → DateTime -
Available on DateTime, provided by the DateTimeBasics extension
Returns a new DateTime instance withduration
added tothis
. -
operator -(
DateTime other) → Duration -
Available on DateTime, provided by the DateTimeBasics extension
Returns the Duration betweenthis
andother
. -
operator <(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeBasics extension
Returns true ifthis
occurs strictly beforeother
, accounting for time zones. -
operator <=(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeBasics extension
Returns true ifthis
occurs at or beforeother
, accounting for time zones. -
operator >(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeBasics extension
Returns true ifthis
occurs strictly afterother
, accounting for time zones. -
operator >=(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeBasics extension
Returns true ifthis
occurs at or afterother
, accounting for time zones.