DateTimeExtension extension
- on
Properties
- asUtc → DateTime?
-
Available on DateTime, provided by the DateTimeExtension extension
Converts the DateTime object to the UTC timezone.no setter - currentTimeStamp → int
-
Available on DateTime, provided by the DateTimeExtension extension
Returns the current timestamp in seconds.no setter - dateOnly → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime with the date of the original, but time set to midnight.no setter - firstDayOfMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime instance representing the first day of the month of this DateTime.no setter - firstDayOfWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime instance representing the first day of the week of this DateTime.no setter - isFirstDayOfMonth → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Checks if this DateTime instance represents the first day of the month.no setter - isLastDayOfMonth → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Checks if this DateTime instance represents the last day of the month.no setter - isNotNull → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Returnstrue
if the given date is notnull
.no setter - isToday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Returnstrue
if the given date is today.no setter - isTomorrow → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Returnstrue
if the given date is tomorrow.no setter - isYesterday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Returnstrue
if the given date is yesterday.no setter - lastDayOfMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime instance representing the last day of the month of this DateTime.no setter - lastDayOfWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime instance representing the last day of the week of this DateTime.no setter - nextDay → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime representing the day after this DateTime.no setter - nextMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime instance representing the exact date of the next coming month.no setter - nextWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime instance representing the exact date of the coming week.no setter - previousDay → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime representing the day before this DateTime.no setter - previousMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime instance representing the exact date of the previous month.no setter - previousWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Returns a DateTime instance representing the exact date of the previous week.no setter - timeAgo → String?
-
Available on DateTime, provided by the DateTimeExtension extension
Returns the time difference from this DateTime to the current DateTime in Indian language.no setter - toTimeAmPm → String?
-
Available on DateTime, provided by the DateTimeExtension extension
Returns the time in AM/PM format for this DateTime.no setter
Methods
-
addDays(
int amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Adds a certain amount of days to this date and returns a new DateTime instance. -
addHours(
int amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Adds a certain amount of hours to this date and returns a new DateTime instance. -
countDays(
DateTime? differenceDateTime) → int -
Available on DateTime, provided by the DateTimeExtension extension
Calculates the number of days between two DateTime objects. -
countHours(
DateTime? differenceDateTime) → int -
Available on DateTime, provided by the DateTimeExtension extension
Calculates the difference in hours between the current DateTime object anddifferenceDateTime
. -
countMinutes(
DateTime? differenceDateTime) → int -
Available on DateTime, provided by the DateTimeExtension extension
Converts the time difference to a number of minutes. -
countMonths(
DateTime? differenceDateTime) → int -
Available on DateTime, provided by the DateTimeExtension extension
Calculates the number of months between the current DateTime object anddifferenceDateTime
. -
countSeconds(
DateTime? differenceDateTime) → int -
Available on DateTime, provided by the DateTimeExtension extension
Converts the time difference to a number of seconds. -
countWeeks(
DateTime? differenceDateTime) → int -
Available on DateTime, provided by the DateTimeExtension extension
Counts the number of weeks between the current DateTime and thedifferenceDateTime
. -
countYears(
DateTime? differenceDateTime) → int -
Available on DateTime, provided by the DateTimeExtension extension
Calculates the number of years between this DateTime instance and another DateTime instance. -
isSameDay(
DateTime b) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Checks whether two DateTime instances are on the same day. -
isSameWeek(
DateTime b) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Checks if two DateTime instances fall within the same week. -
monthName(
{bool isHalfName = false}) → String? -
Available on DateTime, provided by the DateTimeExtension extension
Returns Month name of give this DateTime Example: final date = DateTime.now(); //output: 2023-05-24 13:14:23.593304 print(date.monthName()??""); //output: May -
toIndiaTimeZone(
) → DateTime? -
Available on DateTime, provided by the DateTimeExtension extension
Converts the DateTime object to the Indian time zone. -
weekdayName(
{bool isHalfName = false}) → String? -
Available on DateTime, provided by the DateTimeExtension extension
Returns the name of the weekday for the given date.