DateTimeExtensions extension
- on
Properties
- hourOfPeriod → int
-
Available on DateTime, provided by the DateTimeExtensions extension
Which hour of the current period (e.g., am or pm) this time is.no setter - isToday → bool
-
Available on DateTime, provided by the DateTimeExtensions extension
no setter - period → DayPeriod
-
Available on DateTime, provided by the DateTimeExtensions extension
Whether this time of day is before or after noon.no setter - periodOffset → int
-
Available on DateTime, provided by the DateTimeExtensions extension
The hour at which the current period starts.no setter - quarter → int
-
Available on DateTime, provided by the DateTimeExtensions extension
Equal to: (month / 4).round(); eg. (6/4).round() = 2no setter - timeOfDay → TimeOfDay
-
Available on DateTime, provided by the DateTimeExtensions extension
no setter
Methods
-
copyWith(
{int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) → DateTime -
Available on DateTime, provided by the DateTimeExtensions extension
Copies a DateTime, overriding specified values. -
format(
{String? seprator, DateTimeLang? lang}) → DateTimeFormat -
Available on DateTime, provided by the DateTimeExtensions extension
Sample -
isAtOrAfter(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Returns true ifthis
occurs at or afterother
, accounting for time zones. -
isAtOrBefore(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Returns true ifthis
occurs at or beforeother
, accounting for time zones. -
timeagoSince(
{DateTimeLang? lang, bool showSeconds = true, bool showMinutes = true, bool showHours = true, bool showDays = true, bool showWeeks = false, bool showMonths = true, bool showYears = true}) → Timeago -
Available on DateTime, provided by the DateTimeExtensions extension
Sample
Operators
-
operator +(
Duration duration) → DateTime -
Available on DateTime, provided by the DateTimeExtensions extension
Returns a new DateTime instance withduration
added tothis
. -
operator -(
Duration other) → DateTime -
Available on DateTime, provided by the DateTimeExtensions extension
Returns a new DateTime instance withduration
subtract tothis
. -
operator <(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Returns true ifthis
occurs strictly beforeother
, accounting for time zones. -
operator <=(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Returns true ifthis
occurs at or beforeother
, accounting for time zones. -
operator >(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Returns true ifthis
occurs strictly afterother
, accounting for time zones. -
operator >=(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtensions extension
Returns true ifthis
occurs at or afterother
, accounting for time zones.