DateTimeExtension extension
- on
Properties
- clone → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
no setter - endOfDay → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of a day for this date. The result will be in the local timezone.no setter - endOfHour → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of the hour for this date. The result will be in the local timezone.no setter - endOfISOWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of ISO week for this date. The result will be in the local timezone.no setter - endOfMinute → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of the minute for this date. The result will be in the local timezone.no setter - endOfMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of the month for this date. The result will be in the local timezone.no setter - endOfQuarter → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of quarter for this date. The result will be in the local timezone.no setter - endOfSecond → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of the second for this date. The result will be in the local timezone.no setter - endOfWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of the week for this date. The result will be in the local timezone.no setter - endOfYear → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of the year for this date. The result will be in the local timezone.no setter - getDate → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the day of the month of the given date. The day of the month 1..31.no setter - getDay → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the day of the week of the given date.no setter - getDayOfYear → int
-
Available on DateTime, provided by the DateTimeExtension extension
Days since year started. The result will be in the local timezone.no setter - getDaysInMonth → int
-
Available on DateTime, provided by the DateTimeExtension extension
Days since month started. The result will be in the local timezone.no setter - getDaysInYear → int
-
Available on DateTime, provided by the DateTimeExtension extension
Number of days in current yearno setter - getHours → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the hours of the given date. The hour of the day, expressed as in a 24-hour clock 0..23.no setter - getISOWeek → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the ISO week indexno setter - getISOWeeksInYear → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the number of weeks in an ISO week-numbering yearno setter - getMicroseconds → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the microseconds of the given date. The microsecond 0...999.no setter - getMicrosecondsSinceEpoch → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the microseconds since the 'Unix epoch' 1970-01-01T00:00:00Z (UTC).no setter - getMilliseconds → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the milliseconds of the given date. The millisecond 0...999.no setter - getMillisecondsSinceEpoch → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the milliseconds since the 'Unix epoch' 1970-01-01T00:00:00Z (UTC).no setter - getMinutes → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the minutes of the given date. The minute 0...59.no setter - getMonth → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the month of the given date. The month 1..12.no setter - getSeconds → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the seconds of the given date. The second 0...59.no setter - getTime → int
-
Available on DateTime, provided by the DateTimeExtension extension
get the number of milliseconds since epochno setter - getTimeZoneName → String
-
Available on DateTime, provided by the DateTimeExtension extension
The time zone name. This value is provided by the operating system and may be an abbreviation or a full name. In the browser or on Unix-like systems commonly returns abbreviations, such as 'CET' or 'CEST'. On Windows returns the full name, for example 'Pacific Standard Time'.no setter - getTimeZoneOffset → Duration
-
Available on DateTime, provided by the DateTimeExtension extension
The time zone offset, which is the difference between local time and UTC. The offset is positive for time zones east of UTC. Note, that JavaScript, Python and C return the difference between UTC and local time. Java, C# and Ruby return the difference between local time and UTC.no setter - getWeek → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the week indexno setter - getWeekday → int
-
Available on DateTime, provided by the DateTimeExtension extension
The day of the week monday..sunday. In accordance with ISO 8601 a week starts with Monday, which has the value 1.no setter - getWeekYear → int
-
Available on DateTime, provided by the DateTimeExtension extension
Get the local week-numbering yearno setter - getYear → int
-
Available on DateTime, provided by the DateTimeExtension extension
The yearno setter - isFirstDayOfMonth → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Is the given date the first day of a month?no setter - isFriday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date day is fridayno setter - isFuture → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date isAfterDate.now
no setter - isLastDayOfMonth → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Is the given date the last day of a month?no setter - isLeapYear → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Is the given date in the leap year?no setter - isMonday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date day is mondayno setter - isPast → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date isBeforeDate.now
no setter - isSaturday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date day is saturdayno setter - isSunday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date day is sundayno setter - isThisHour → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same hour as DateTime.nowno setter - isThisMinute → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same minute as DateTime.nowno setter - isThisMonth → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same month as DateTime.nowno setter - isThisSecond → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same second as DateTime.nowno setter - isThisYear → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same year as DateTime.nowno setter - isThursday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date day is thursdayno setter - isToday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same day asDateTime.today
no setter - isTomorrow → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same day asDateTime.tomorrow
no setter - isTuesday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date day is tuesdayno setter - isUTC → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this DateTime is set as UTC.no setter - isWednesday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this date day is wednesdayno setter - isWeekend → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Return true if this DateTime is a saturday or a sundayno setter - isYesterday → bool
-
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same day asDateTime.yesterday
no setter - local → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get Local DateTime from this DateTimeno setter - nextDay → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
The day after The day after this DateTimeno setter - nextMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
The month after this DateTimeno setter - nextWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
The week after this DateTimeno setter - nextYear → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
The year after this DateTimeno setter - previousDay → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
The day previous this DateTimeno setter - previousMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
The month previous this DateTimeno setter - previousWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
The week previous this DateTimeno setter - previousYear → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
The year previous this DateTimeno setter - secondsSinceEpoch → int
-
Available on DateTime, provided by the DateTimeExtension extension
Number of seconds since epoch timeno setter - startOfDay → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of Day of this DateTime in local time.no setter - startOfHour → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of Hour of this DateTime in local time.no setter - startOfISOWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of week (ISO week) of this DateTime in local time.no setter - startOfISOWeekYear → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get the start of a local week-numbering yearno setter - startOfMinute → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of minute of this DateTime in local time.no setter - startOfMonth → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of month of this DateTime in local time.no setter - startOfQuarter → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of quarter of this DateTime in local time.no setter - startOfSecond → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of second of this DateTime in local time.no setter - startOfWeek → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of week of this DateTime in local time.no setter - startOfWeekYear → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get the start of a local week-numbering yearno setter - startOfYear → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of year of this DateTime in local time.no setter - timestamp → int
-
Available on DateTime, provided by the DateTimeExtension extension
get the number of milliseconds since epochno setter - toLocalTime → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
GetDate
object in LocalTime of current object.no setter - toUTC → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
GetDate
object as UTC of current object.no setter - utc → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get UTC DateTime from this DateTimeno setter
Methods
-
addDays(
int amount, [bool ignoreDaylightSavings = false]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of days to this date -
addHours(
int amount, [bool ignoreDaylightSavings = false]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of hours to this date -
addMicroseconds(
int amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of microseconds to this date -
addMilliseconds(
int amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of milliseconds to this date -
addMinutes(
int amount, [bool ignoreDaylightSavings = false]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of minutes to this date -
addMonths(
int amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of months to this date -
addQuarters(
int amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of quarters to this date -
addSeconds(
int amount, [bool ignoreDaylightSavings = false]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of seconds to this date -
addWeeks(
int amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of weeks to this date -
addYears(
int amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Add a certain amount of years to this date -
closestIndexTo(
Iterable< DateTime> datesArray) → int? -
Available on DateTime, provided by the DateTimeExtension extension
Get index of the closest day to current one, returns null if empty Iterable is passed as argument -
closestTo(
Iterable< DateTime> datesArray) → DateTime? -
Available on DateTime, provided by the DateTimeExtension extension
Get closest day to current one, returns null if empty Iterable is passed as argument -
compare(
DateTime other) → int -
Available on DateTime, provided by the DateTimeExtension extension
Compares this Date object toother
, returning zero if the values are equal. Returns a negative value if this Date isBeforeother
. It returns 0 if it isAtSameMomentAsother
, and returns a positive value otherwise (when this isAfterother
). -
diff(
DateTime other) → Duration -
Available on DateTime, provided by the DateTimeExtension extension
Get the difference between this data and other date as a Duration -
differenceInDays(
DateTime other) → int -
Available on DateTime, provided by the DateTimeExtension extension
Difference in days between this date and other -
differenceInHours(
DateTime other) → int -
Available on DateTime, provided by the DateTimeExtension extension
Difference in hours between this date and other -
differenceInMicroseconds(
DateTime other) → int -
Available on DateTime, provided by the DateTimeExtension extension
Difference in microseconds between this date and other -
differenceInMilliseconds(
DateTime other) → int -
Available on DateTime, provided by the DateTimeExtension extension
Difference in milliseconds between this date and other -
differenceInMinutes(
DateTime other) → int -
Available on DateTime, provided by the DateTimeExtension extension
Difference in minutes between this date and other -
differenceInSeconds(
DateTime other) → int -
Available on DateTime, provided by the DateTimeExtension extension
Difference in seconds between this date and other -
eachDay(
DateTime date, {bool ignoreDaylightSavings = false}) → Iterable< DateTime> -
Available on DateTime, provided by the DateTimeExtension extension
Return an Iterable of dates which is inclusive tothis
but exclusive todate
-
equals(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
-
format(
String pattern, [String locale = 'en_US']) → String -
Available on DateTime, provided by the DateTimeExtension extension
Format this DateTime following theString pattern
-
isEqual(
dynamic other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Check if a date is equals to other -
isSameDay(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same day as other -
isSameHour(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same hour as other -
isSameMinute(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same minute as other -
isSameMonth(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same month as other -
isSameOrAfter(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Return true if other isEqual or isAfter to this date -
isSameOrBefore(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Return true if other isEqual or isBefore to this date -
isSameSecond(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same second as other -
isSameYear(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Check if this date is in the same year as other -
isWithinInterval(
Interval interval) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Checks if a DateTime is within an Interval -
isWithinRange(
DateTime startDate, DateTime endDate) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Checks if a DateTime is within a Rage (two dates that makes an Interval) -
setDay(
int day, [int? hour, int? minute, int? second, int? millisecond, int? microsecond]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changeday
of this date -
setHour(
int hour, [int? minute, int? second, int? millisecond, int? microsecond]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changehour
of this date -
setMicrosecond(
int microsecond) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changemicrosecond
of this date -
setMillisecond(
int millisecond, [int? microsecond]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changemillisecond
of this date -
setMinute(
int minute, [int? second, int? millisecond, int? microsecond]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changeminute
of this date -
setMonth(
int month, [int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changemonth
of this date -
setSecond(
int second, [int? millisecond, int? microsecond]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changesecond
of this date -
setWeekDay(
int weekday, [int weekStartsOn = DateTime.sunday]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changeweekday
of this date -
setYear(
int year, [int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Changeyear
of this date -
sub(
Duration duration) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts a Duration from this DateTime -
subDays(
int amount, [bool ignoreDaylightSavings = false]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts an amount of days from this DateTime -
subHours(
int amount, [bool ignoreDaylightSavings = false]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts an amount of hours from this DateTime -
subMicroseconds(
dynamic amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts an amount of microseconds from this DateTime -
subMilliseconds(
dynamic amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts an amount of milliseconds from this DateTime -
subMinutes(
dynamic amount, [bool ignoreDaylightSavings = false]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts an amount of minutes from this DateTime -
subMonths(
dynamic amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts an amount of months from this DateTime -
subSeconds(
dynamic amount, [bool ignoreDaylightSavings = false]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts an amount of seconds from this DateTime -
subtract(
Duration duration) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtract a Duration to this date -
subYears(
dynamic amount) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Subtracts an amount of years from this DateTime -
timeago(
{String? locale, DateTime? clock, bool? allowFromNow}) → String -
Available on DateTime, provided by the DateTimeExtension extension
Formats provideddate
to a fuzzy time like 'a moment ago' (use timeago package to change locales) -
toHumanString(
) → String -
Available on DateTime, provided by the DateTimeExtension extension
Operators
-
operator +(
Duration other) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
-
operator -(
Duration other) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
-
operator <(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
-
operator <=(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
-
operator >(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
-
operator >=(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Static Properties
- endOfToday → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of today. The result will be in the local timezone.no setter - endOfTomorrow → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of tomorrow. The result will be in the local timezone.no setter - endOfYesterday → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Return the end of yesterday. The result will be in the local timezone.no setter - startOfToday → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Get a DateTime representing start of today ofDateTime.today
in local time.no setter - today → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Current date (Same asDate.now
)no setter - tomorrow → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Tomorrow at same hour / minute / second as nowno setter - yesterday → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
Yesterday at same hour / minute / second as nowno setter
Static Methods
-
areRangesOverlapping(
DateTime initialRangeStartDate, DateTime initialRangeEndDate, DateTime comparedRangeStartDate, DateTime comparedRangeEndDate) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Know if two ranges of dates overlaps -
compareAsc(
DateTime dateLeft, DateTime dateRight) → int -
Available on DateTime, provided by the DateTimeExtension extension
Compare the two dates and return 1 if the first date isAfter the second, -1 if the first date isBefore the second or 0 first date isEqual the second. -
compareDesc(
DateTime dateLeft, DateTime dateRight) → int -
Available on DateTime, provided by the DateTimeExtension extension
Compare the two dates and return -1 if the first date isAfter the second, 1 if the first date isBefore the second or 0 first date isEqual the second. -
fromSecondsSinceEpoch(
int secondsSinceEpoch, {bool isUtc = false}) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Number of seconds since epoch time / A.K.A Unix timestamp -
isDate(
dynamic argument) → bool -
Available on DateTime, provided by the DateTimeExtension extension
Check if a Object if a DateTime, use for validation purposes -
max(
DateTime left, DateTime right) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Returns true if left isAfter right -
min(
DateTime left, DateTime right) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Returns true if left isBefore right -
parse(
String dateString, {String? pattern, String locale = 'en_US', bool isUTC = false}) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Transforms a date that follows a pattern from a String representation to a DateTime object -
unix(
int seconds) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
Create aDate
object from a Unix timestamp