DateTimeExtension extension
Extension for DateTime.
- on
Properties
- elapsedTime → Duration
-
Returns the elapsed time of
this
DateTime until now (DateTime.now).no setter
Methods
-
formatTo(
String format, {String? locale}) → String -
Formats to
format
, usingDateFormat
. -
formatToYMD(
{String dateDelimiter = '-', String? locale}) → String -
Formats to
yyyy-MM-dd
. -
formatToYMDHm(
{String dateDelimiter = '-', String hourDelimiter = ':', String? locale}) → String -
Formats to
yyyy-MM-dd HH:mm
. -
formatToYMDHms(
{String dateDelimiter = '-', String hourDelimiter = ':', String? locale}) → String -
Formats to
yyyy-MM-dd HH:mm:ss
. -
toStringDifference(
DateTime other, {bool asUTC = false}) → String -
Returns
this
DateTime.toString removing the part that is equals toother
.