DatabaseDateTime class final

A date read from a driver that returns DateTimes, with the text PDO would have returned. An uncast column reaches Laravel's JSON as that text (2024-01-01 10:00:00), not as an ISO-8601 date.

Inheritance
Available extensions

Constructors

DatabaseDateTime(DateTime value, String text)

Properties

day → int
The day of the month [1..31].
no setterinherited
daysInMonth → int

Available on DateTime, provided by the DaravelDateTime extension

no setter
endOfDay → DateTime

Available on DateTime, provided by the DaravelDateTime extension

no setter
endOfMonth → DateTime

Available on DateTime, provided by the DaravelDateTime extension

no setter
endOfWeek → DateTime

Available on DateTime, provided by the DaravelDateTime extension

Sunday 23:59:59.999999 of this week.
no setter
endOfYear → DateTime

Available on DateTime, provided by the DaravelDateTime extension

no setter
hashCode → int
The hash code for this object.
no setterinherited
hour → int
The hour of the day, expressed as in a 24-hour clock [0..23].
no setterinherited
isFuture → bool

Available on DateTime, provided by the DaravelDateTime extension

no setter
isPast → bool

Available on DateTime, provided by the DaravelDateTime extension

no setter
isToday → bool

Available on DateTime, provided by the DaravelDateTime extension

no setter
isUtc → bool
True if this DateTime is set to UTC time.
finalinherited
isWeekday → bool

Available on DateTime, provided by the DaravelDateTime extension

no setter
isWeekend → bool

Available on DateTime, provided by the DaravelDateTime extension

no setter
microsecond → int
The microsecond [0...999].
no setterinherited
microsecondsSinceEpoch → int
The number of microseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setterinherited
millisecond → int
The millisecond [0...999].
no setterinherited
millisecondsSinceEpoch → int
The number of milliseconds since the "Unix epoch" 1970-01-01T00:00:00Z (UTC).
no setterinherited
minute → int
The minute [0...59].
no setterinherited
month → int
The month [1..12].
no setterinherited
plain → DateTime
This date without its text, for a cast or timestamp attribute.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
second → int
The second [0...59].
no setterinherited
startOfDay → DateTime

Available on DateTime, provided by the DaravelDateTime extension

no setter
startOfMonth → DateTime

Available on DateTime, provided by the DaravelDateTime extension

no setter
startOfWeek → DateTime

Available on DateTime, provided by the DaravelDateTime extension

Monday 00:00 of this week (Carbon's default for en and id).
no setter
startOfYear → DateTime

Available on DateTime, provided by the DaravelDateTime extension

no setter
text → String
final
timeZoneName → String
The time zone name.
no setterinherited
timeZoneOffset → Duration
The time zone offset, which is the difference between local time and UTC.
no setterinherited
weekday → int
The day of the week monday..sunday.
no setterinherited
year → int
The year.
no setterinherited

Methods

add(Duration duration) → DateTime
Returns a new DateTime instance with duration added to this DateTime.
inherited
addMonths(int months) → DateTime

Available on DateTime, provided by the DaravelDateTime extension

addMonthsNoOverflow(int months) → DateTime

Available on DateTime, provided by the DaravelDateTime extension

addYears(int years) → DateTime

Available on DateTime, provided by the DaravelDateTime extension

addYearsNoOverflow(int years) → DateTime

Available on DateTime, provided by the DaravelDateTime extension

compareTo(DateTime other) → int
Compares this DateTime object to other, returning zero if the values are equal.
inherited
copyWith({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond, bool? isUtc}) → DateTime

Available on DateTime, provided by the DateTimeCopyWith extension

Creates a new DateTime from this one by updating individual properties.
difference(DateTime other) → Duration
Returns a Duration with the difference when subtracting other from this DateTime.
inherited
diffForHumans({DateTime? other, String locale = 'en'}) → String

Available on DateTime, provided by the DaravelDateTime extension

Carbon's diffForHumans(): the largest whole calendar unit, so 5 minutes ago, 2 hours from now, 4 weeks ago, 1 month ago (en), or 5 menit yang lalu, 2 jam dari sekarang (id). With other, relative to it: 1 day before / 1 hari sebelumnya.
isAfter(DateTime other) → bool
Whether this DateTime occurs after other.
inherited
isAtSameMomentAs(DateTime other) → bool
Whether this DateTime occurs at the same moment as other.
inherited
isBefore(DateTime other) → bool
Whether this DateTime occurs before other.
inherited
isBetween(DateTime start, DateTime end, {bool inclusive = true}) → bool

Available on DateTime, provided by the DaravelDateTime extension

Carbon's between(): start and end included unless inclusive is false.
isSameDay(DateTime other) → bool

Available on DateTime, provided by the DaravelDateTime extension

isSameMonth(DateTime other) → bool

Available on DateTime, provided by the DaravelDateTime extension

isSameYear(DateTime other) → bool

Available on DateTime, provided by the DaravelDateTime extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subMonths(int months) → DateTime

Available on DateTime, provided by the DaravelDateTime extension

subMonthsNoOverflow(int months) → DateTime

Available on DateTime, provided by the DaravelDateTime extension

subtract(Duration duration) → DateTime
Returns a new DateTime instance with duration subtracted from this DateTime.
inherited
subYears(int years) → DateTime

Available on DateTime, provided by the DaravelDateTime extension

subYearsNoOverflow(int years) → DateTime

Available on DateTime, provided by the DaravelDateTime extension

toIso8601String() → String
Returns an ISO-8601 full-precision extended format representation.
inherited
toLocal() → DateTime
Returns this DateTime value in the local time zone.
inherited
toString() → String
Returns a human-readable string for this instance.
inherited
toUtc() → DateTime
Returns this DateTime value in the UTC time zone.
inherited

Operators

operator ==(Object other) → bool
Whether other is a DateTime at the same moment and in the same time zone (UTC or local).
inherited