DateExt extension

Extension methods for DateTime objects.

on

Methods

st_timeAgo() TimeAgo

Available on DateTime, provided by the DateExt extension

Computes the time elapsed since the date.
st_toEn({bool withTime = false, bool withDay = true}) String

Available on DateTime, provided by the DateExt extension

Converts the date to an English-formatted string.
st_toFormat(String format) String

Available on DateTime, provided by the DateExt extension

Formats the date according to the specified format.
st_toFr({bool withTime = false, bool withDay = true}) String

Available on DateTime, provided by the DateExt extension

Converts the date to a French-formatted string.
st_toJson() Map<String, int>

Available on DateTime, provided by the DateExt extension

Converts the date to a JSON representation.
st_toTimestamp() String

Available on DateTime, provided by the DateExt extension

Converts the date to a timestamp string.

Operators

operator +(Duration other) DateTime

Available on DateTime, provided by the DateExt extension

Adds the given other duration to the date.
operator -(Duration other) DateTime

Available on DateTime, provided by the DateExt extension

Subtracts the given other duration from the date.