DateTimeExtensions extension

on

Properties

hourOfPeriod int
Which hour of the current period (e.g., am or pm) this time is.
no setter
isToday bool
no setter
period DayPeriod
Whether this time of day is before or after noon.
no setter
periodOffset int
The hour at which the current period starts.
no setter
quarter int
Equal to: (month / 4).round(); eg. (6/4).round() = 2
no setter
timeOfDay TimeOfDay
no setter

Methods

copyWith({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) DateTime
Copies a DateTime, overriding specified values.
format({String? seprator, DateTimeLang? lang}) DateTimeFormat
Sample
isAtOrAfter(DateTime other) bool
Returns true if this occurs at or after other, accounting for time zones.
isAtOrBefore(DateTime other) bool
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
Sample

Operators

operator +(Duration duration) DateTime
Returns a new DateTime instance with duration added to this.
operator -(Duration other) DateTime
Returns a new DateTime instance with duration subtract to this.
operator <(DateTime other) bool
Returns true if this occurs strictly before other, accounting for time zones.
operator <=(DateTime other) bool
Returns true if this occurs at or before other, accounting for time zones.
operator >(DateTime other) bool
Returns true if this occurs strictly after other, accounting for time zones.
operator >=(DateTime other) bool
Returns true if this occurs at or after other, accounting for time zones.