DateTimeExtension extension
Extension on DateTime providing date and time formatting.
- on
Properties
- dayName → String
-
Available on DateTime, provided by the DateTimeExtension extension
Returns full day name.no setter - dayNameShort → String
-
Available on DateTime, provided by the DateTimeExtension extension
Returns short day name.no setter - isToday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Returns true if this date is today.no setter - monthName → String
-
Available on DateTime, provided by the DateTimeExtension extension
Returns full month name.no setter - monthNameShort → String
-
Available on DateTime, provided by the DateTimeExtension extension
Returns short month name.no setter -
timeAgoNotifier
→ ValueNotifier<
String> -
Available on DateTime, provided by the DateTimeExtension extension
Returns a ValueNotifier that updates the relative time string periodically.no setter - toDateAndTimeOnly → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date and time as 'Fri June 12, 2026 at 05:00 PM'.no setter - toDateAndTimeWithSlashes → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date and time as '24/02/2026 12:03 AM'.no setter - toDateTime → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date and time as '24th, Feb 2024 - 10:30 PM'.no setter - toDateTimeLong → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date and time as 'February 24, 2024, 10:30 PM'.no setter - toDateTimeWithoutComma → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date and time as '24 February 2024 10:30 PM'.no setter - toDateWithSlashes → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date as '24/02/2026'.no setter - toDayMonthYear → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date as 'Fri June 12, 2026'.no setter - toDdMmmmYyyy → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date as '24 February 2024'.no setter - toDdMmmYyyy → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date as '24th, Feb 2024'.no setter - toFullTimeAmPm → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats time as '10:30:05 PM'.no setter - toMmmmDdYyyy → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date as 'February 24, 2024'.no setter - toMonthYear → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats date as 'February 2024'.no setter - toTime → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats time as '20:30'.no setter - toTimeAmPm → String
-
Available on DateTime, provided by the DateTimeExtension extension
Formats time as '10:30 PM'.no setter - toUtcString → String
-
Available on DateTime, provided by the DateTimeExtension extension
Returns this datetime as an ISO-8601 UTC string.no setter
Methods
-
isAfterOrSameAs(
DateTime date) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Returns true if this date is after or same as the given date. -
isBeforeOrSameAs(
DateTime date) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Returns true if this date is before or same as the given date. -
isSameAs(
DateTime date) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Returns true if this date is same as the given date. -
timeRemaining(
{String beforeDueDate = 'from now', String afterDueDate = 'overdue', DateTime? targetDate}) → String -
Available on DateTime, provided by the DateTimeExtension extension
Formats date as '2 hours to go' or '2 days to go' or '2 minutes overdue' etc. -
timeRemainingUntil(
[DateTime? now]) → String -
Available on DateTime, provided by the DateTimeExtension extension
Calculates time remaining in seconds untilnowand returns '04:39:01:58' or '0' if no time remaining. -
toDateAndTimeWithTimeZone(
String timeZone) → String -
Available on DateTime, provided by the DateTimeExtension extension
Formats date and time as 'Fri June 12, 2026 at 05:00 PM WAT'. -
toTimeWithTimeZone(
String timeZone) → String -
Available on DateTime, provided by the DateTimeExtension extension
Formats time as '05:00 PM WAT'.