DateTimeExtensions extension

on

Properties

endOfDay DateTime

Available on DateTime, provided by the DateTimeExtensions extension

End of current day (23:59:59.999)
no setter
endOfMonth DateTime

Available on DateTime, provided by the DateTimeExtensions extension

End of month (last day)
no setter
endOfWeek DateTime

Available on DateTime, provided by the DateTimeExtensions extension

End of week (assuming week ends on Sunday)
no setter
isToday bool

Available on DateTime, provided by the DateTimeExtensions extension

Is this date today?
no setter
isTomorrow bool

Available on DateTime, provided by the DateTimeExtensions extension

Is this date tomorrow?
no setter
isWeekday bool

Available on DateTime, provided by the DateTimeExtensions extension

Is this a weekday (Mon-Fri)?
no setter
isWeekend bool

Available on DateTime, provided by the DateTimeExtensions extension

Is this a weekend? (Saturday or Sunday)
no setter
isYesterday bool

Available on DateTime, provided by the DateTimeExtensions extension

Is this date yesterday?
no setter
relativeTime String

Available on DateTime, provided by the DateTimeExtensions extension

Returns 'Just now', 'X minutes ago', 'Yesterday', etc.
no setter
startOfDay DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Start of current day (00:00:00)
no setter
startOfMonth DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Start of month (first day)
no setter
startOfWeek DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Start of week (assuming week starts on Monday)
no setter
toIso8601WithMilliseconds String

Available on DateTime, provided by the DateTimeExtensions extension

Convert to ISO string with milliseconds (more precision)
no setter

Methods

addDays(int days) DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Add days easily
addHours(int hours) DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Add hours
differenceInDays(DateTime other) int

Available on DateTime, provided by the DateTimeExtensions extension

Difference from another date in days
differenceInHours(DateTime other) int

Available on DateTime, provided by the DateTimeExtensions extension

Difference from another date in hours
format(String pattern) String

Available on DateTime, provided by the DateTimeExtensions extension

Format using intl (e.g., 'yyyy-MM-dd' or 'dd/MM/yyyy')
isSameDate(DateTime other) bool

Available on DateTime, provided by the DateTimeExtensions extension

Is the date the same as another date (ignores time)
subtractDays(int days) DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Subtract days easily
subtractHours(int hours) DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Subtract hours

Static Properties

now DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Now as DateTime (alias for DateTime.now())
no setter
today DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Today with no time (only date part)
no setter
tomorrow DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Tomorrow's date
no setter
yesterday DateTime

Available on DateTime, provided by the DateTimeExtensions extension

Yesterday's date
no setter