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() = 2
no 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 if this occurs at or after other, accounting for time zones.
isAtOrBefore(DateTime other) bool

Available on DateTime, provided by the DateTimeExtensions extension

Returns true if this occurs at or before other, 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 with duration added to this.
operator -(Duration other) DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Returns a new DateTime instance with duration subtract to this.
operator <(DateTime other) bool

Available on DateTime, provided by the DateTimeExtensions extension

Returns true if this occurs strictly before other, accounting for time zones.
operator <=(DateTime other) bool

Available on DateTime, provided by the DateTimeExtensions extension

Returns true if this occurs at or before other, accounting for time zones.
operator >(DateTime other) bool

Available on DateTime, provided by the DateTimeExtensions extension

Returns true if this occurs strictly after other, accounting for time zones.
operator >=(DateTime other) bool

Available on DateTime, provided by the DateTimeExtensions extension

Returns true if this occurs at or after other, accounting for time zones.