Date
A simple API extension for DateTime.
<autodoc generated by composer phpdoc
>
Table of Contents
Properties
- $age : int
- $centuriesInMillennium : int
- $century : int
- $centuryOfMillennium : int
- $day : int
- $dayName : string
- $dayOfCentury : int
- $dayOfDecade : int
- $dayOfMillennium : int
- $dayOfMonth : int
- $dayOfQuarter : int
- $dayOfWeek : int
- $dayOfWeekIso : int
- $dayOfYear : int
- $daysInCentury : int
- $daysInDecade : int
- $daysInMillennium : int
- $daysInMonth : int
- $daysInQuarter : int
- $daysInWeek : int
- $daysInYear : int
- $decade : int
- $decadeOfCentury : int
- $decadeOfMillennium : int
- $decadesInCentury : int
- $decadesInMillennium : int
- $dst : bool
- $englishDayOfWeek : string
- $englishMonth : string
- $firstWeekDay : int
- $hour : int
- $hourOfCentury : int
- $hourOfDay : int
- $hourOfDecade : int
- $hourOfMillennium : int
- $hourOfMonth : int
- $hourOfQuarter : int
- $hourOfWeek : int
- $hourOfYear : int
- $hoursInCentury : int
- $hoursInDay : int
- $hoursInDecade : int
- $hoursInMillennium : int
- $hoursInMonth : int
- $hoursInQuarter : int
- $hoursInWeek : int
- $hoursInYear : int
- $isoWeek : int
- $isoWeeksInYear : int
- $isoWeekYear : int
- $lastWeekDay : int
- $latinMeridiem : string
- $latinUpperMeridiem : string
- $local : bool
- $locale : string
- $localeDayOfWeek : string
- $localeMonth : string
- $meridiem : string
- $micro : int
- $microsecond : int
- $microsecondOfCentury : int
- $microsecondOfDay : int
- $microsecondOfDecade : int
- $microsecondOfHour : int
- $microsecondOfMillennium : int
- $microsecondOfMillisecond : int
- $microsecondOfMinute : int
- $microsecondOfMonth : int
- $microsecondOfQuarter : int
- $microsecondOfSecond : int
- $microsecondOfWeek : int
- $microsecondOfYear : int
- $microsecondsInCentury : int
- $microsecondsInDay : int
- $microsecondsInDecade : int
- $microsecondsInHour : int
- $microsecondsInMillennium : int
- $microsecondsInMillisecond : int
- $microsecondsInMinute : int
- $microsecondsInMonth : int
- $microsecondsInQuarter : int
- $microsecondsInSecond : int
- $microsecondsInWeek : int
- $microsecondsInYear : int
- $millennium : int
- $milli : int
- $millisecond : int
- $millisecondOfCentury : int
- $millisecondOfDay : int
- $millisecondOfDecade : int
- $millisecondOfHour : int
- $millisecondOfMillennium : int
- $millisecondOfMinute : int
- $millisecondOfMonth : int
- $millisecondOfQuarter : int
- $millisecondOfSecond : int
- $millisecondOfWeek : int
- $millisecondOfYear : int
- $milliseconds : int
- $millisecondsInCentury : int
- $millisecondsInDay : int
- $millisecondsInDecade : int
- $millisecondsInHour : int
- $millisecondsInMillennium : int
- $millisecondsInMinute : int
- $millisecondsInMonth : int
- $millisecondsInQuarter : int
- $millisecondsInSecond : int
- $millisecondsInWeek : int
- $millisecondsInYear : int
- $minDayName : string
- $minute : int
- $minuteOfCentury : int
- $minuteOfDay : int
- $minuteOfDecade : int
- $minuteOfHour : int
- $minuteOfMillennium : int
- $minuteOfMonth : int
- $minuteOfQuarter : int
- $minuteOfWeek : int
- $minuteOfYear : int
- $minutesInCentury : int
- $minutesInDay : int
- $minutesInDecade : int
- $minutesInHour : int
- $minutesInMillennium : int
- $minutesInMonth : int
- $minutesInQuarter : int
- $minutesInWeek : int
- $minutesInYear : int
- $month : int
- $monthName : string
- $monthOfCentury : int
- $monthOfDecade : int
- $monthOfMillennium : int
- $monthOfQuarter : int
- $monthOfYear : int
- $monthsInCentury : int
- $monthsInDecade : int
- $monthsInMillennium : int
- $monthsInQuarter : int
- $monthsInYear : int
- $noZeroHour : int
- $offset : int
- $offsetHours : int
- $offsetMinutes : int
- $quarter : int
- $quarterOfCentury : int
- $quarterOfDecade : int
- $quarterOfMillennium : int
- $quarterOfYear : int
- $quartersInCentury : int
- $quartersInDecade : int
- $quartersInMillennium : int
- $quartersInYear : int
- $second : int
- $secondOfCentury : int
- $secondOfDay : int
- $secondOfDecade : int
- $secondOfHour : int
- $secondOfMillennium : int
- $secondOfMinute : int
- $secondOfMonth : int
- $secondOfQuarter : int
- $secondOfWeek : int
- $secondOfYear : int
- $secondsInCentury : int
- $secondsInDay : int
- $secondsInDecade : int
- $secondsInHour : int
- $secondsInMillennium : int
- $secondsInMinute : int
- $secondsInMonth : int
- $secondsInQuarter : int
- $secondsInWeek : int
- $secondsInYear : int
- $shortDayName : string
- $shortEnglishDayOfWeek : string
- $shortEnglishMonth : string
- $shortLocaleDayOfWeek : string
- $shortLocaleMonth : string
- $shortMonthName : string
- $timestamp : int|float|string
- $timezone : CarbonTimeZone
- $timezoneAbbreviatedName : string
- $timezoneName : string
- $tz : CarbonTimeZone
- $tzAbbrName : string
- $tzName : string
- $upperMeridiem : string
- $utc : bool
- $week : int
- $weekNumberInMonth : int
- $weekOfCentury : int
- $weekOfDecade : int
- $weekOfMillennium : int
- $weekOfMonth : int
- $weekOfQuarter : int
- $weekOfYear : int
- $weeksInCentury : int
- $weeksInDecade : int
- $weeksInMillennium : int
- $weeksInMonth : int
- $weeksInQuarter : int
- $weeksInYear : int
- $weekYear : int
- $year : int
- $yearIso : int
- $yearOfCentury : int
- $yearOfDecade : int
- $yearOfMillennium : int
- $yearsInCentury : int
- $yearsInDecade : int
- $yearsInMillennium : int
- $days : array<string|int, mixed>
- Names of days of the week.
- $units : array<string|int, mixed>
- List of unit and magic methods associated as doc-comments.
Methods
- __call() : mixed
- Dynamically handle calls to the class.
- __callStatic() : mixed
- Dynamically handle calls to the class.
- __get() : string|int|bool|DateTimeZone|null
- Get a part of the Carbon object.
- __isset() : bool
- Check if an attribute exists on the object
- __set() : void
- Set a part of the Carbon object
- addCenturies() : CarbonInterface
- addCenturiesNoOverflow() : CarbonInterface
- addCenturiesWithNoOverflow() : CarbonInterface
- addCenturiesWithoutOverflow() : CarbonInterface
- addCenturiesWithOverflow() : CarbonInterface
- addCentury() : CarbonInterface
- addCenturyNoOverflow() : CarbonInterface
- addCenturyWithNoOverflow() : CarbonInterface
- addCenturyWithoutOverflow() : CarbonInterface
- addCenturyWithOverflow() : CarbonInterface
- addDay() : CarbonInterface
- addDays() : CarbonInterface
- addDecade() : CarbonInterface
- addDecadeNoOverflow() : CarbonInterface
- addDecades() : CarbonInterface
- addDecadesNoOverflow() : CarbonInterface
- addDecadesWithNoOverflow() : CarbonInterface
- addDecadesWithoutOverflow() : CarbonInterface
- addDecadesWithOverflow() : CarbonInterface
- addDecadeWithNoOverflow() : CarbonInterface
- addDecadeWithoutOverflow() : CarbonInterface
- addDecadeWithOverflow() : CarbonInterface
- addHour() : CarbonInterface
- addHours() : CarbonInterface
- addMicro() : CarbonInterface
- addMicros() : CarbonInterface
- addMicrosecond() : CarbonInterface
- addMicroseconds() : CarbonInterface
- addMillennia() : CarbonInterface
- addMillenniaNoOverflow() : CarbonInterface
- addMillenniaWithNoOverflow() : CarbonInterface
- addMillenniaWithoutOverflow() : CarbonInterface
- addMillenniaWithOverflow() : CarbonInterface
- addMillennium() : CarbonInterface
- addMillenniumNoOverflow() : CarbonInterface
- addMillenniumWithNoOverflow() : CarbonInterface
- addMillenniumWithoutOverflow() : CarbonInterface
- addMillenniumWithOverflow() : CarbonInterface
- addMilli() : CarbonInterface
- addMillis() : CarbonInterface
- addMillisecond() : CarbonInterface
- addMilliseconds() : CarbonInterface
- addMinute() : CarbonInterface
- addMinutes() : CarbonInterface
- addMonth() : CarbonInterface
- addMonthNoOverflow() : CarbonInterface
- addMonths() : CarbonInterface
- addMonthsNoOverflow() : CarbonInterface
- addMonthsWithNoOverflow() : CarbonInterface
- addMonthsWithoutOverflow() : CarbonInterface
- addMonthsWithOverflow() : CarbonInterface
- addMonthWithNoOverflow() : CarbonInterface
- addMonthWithoutOverflow() : CarbonInterface
- addMonthWithOverflow() : CarbonInterface
- addQuarter() : CarbonInterface
- addQuarterNoOverflow() : CarbonInterface
- addQuarters() : CarbonInterface
- addQuartersNoOverflow() : CarbonInterface
- addQuartersWithNoOverflow() : CarbonInterface
- addQuartersWithoutOverflow() : CarbonInterface
- addQuartersWithOverflow() : CarbonInterface
- addQuarterWithNoOverflow() : CarbonInterface
- addQuarterWithoutOverflow() : CarbonInterface
- addQuarterWithOverflow() : CarbonInterface
- addSecond() : CarbonInterface
- addSeconds() : CarbonInterface
- addUnitNoOverflow() : static
- Add any unit to a new value without overflowing current other unit given.
- addUTCCenturies() : CarbonInterface
- addUTCCentury() : CarbonInterface
- addUTCDay() : CarbonInterface
- addUTCDays() : CarbonInterface
- addUTCDecade() : CarbonInterface
- addUTCDecades() : CarbonInterface
- addUTCHour() : CarbonInterface
- addUTCHours() : CarbonInterface
- addUTCMicro() : CarbonInterface
- addUTCMicros() : CarbonInterface
- addUTCMicrosecond() : CarbonInterface
- addUTCMicroseconds() : CarbonInterface
- addUTCMillennia() : CarbonInterface
- addUTCMillennium() : CarbonInterface
- addUTCMilli() : CarbonInterface
- addUTCMillis() : CarbonInterface
- addUTCMillisecond() : CarbonInterface
- addUTCMilliseconds() : CarbonInterface
- addUTCMinute() : CarbonInterface
- addUTCMinutes() : CarbonInterface
- addUTCMonth() : CarbonInterface
- addUTCMonths() : CarbonInterface
- addUTCQuarter() : CarbonInterface
- addUTCQuarters() : CarbonInterface
- addUTCSecond() : CarbonInterface
- addUTCSeconds() : CarbonInterface
- addUTCWeek() : CarbonInterface
- addUTCWeeks() : CarbonInterface
- addUTCYear() : CarbonInterface
- addUTCYears() : CarbonInterface
- addWeek() : CarbonInterface
- addWeekday() : CarbonInterface
- addWeekdays() : CarbonInterface
- addWeeks() : CarbonInterface
- addYear() : CarbonInterface
- addYearNoOverflow() : CarbonInterface
- addYears() : CarbonInterface
- addYearsNoOverflow() : CarbonInterface
- addYearsWithNoOverflow() : CarbonInterface
- addYearsWithoutOverflow() : CarbonInterface
- addYearsWithOverflow() : CarbonInterface
- addYearWithNoOverflow() : CarbonInterface
- addYearWithoutOverflow() : CarbonInterface
- addYearWithOverflow() : CarbonInterface
- avoidMutation() : static
- Clone the current instance if it's mutable.
- carbonize() : static
- Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
- ceilCenturies() : CarbonInterface
- ceilCentury() : CarbonInterface
- ceilDay() : CarbonInterface
- ceilDays() : CarbonInterface
- ceilDecade() : CarbonInterface
- ceilDecades() : CarbonInterface
- ceilHour() : CarbonInterface
- ceilHours() : CarbonInterface
- ceilMicrosecond() : CarbonInterface
- ceilMicroseconds() : CarbonInterface
- ceilMillennia() : CarbonInterface
- ceilMillennium() : CarbonInterface
- ceilMillisecond() : CarbonInterface
- ceilMilliseconds() : CarbonInterface
- ceilMinute() : CarbonInterface
- ceilMinutes() : CarbonInterface
- ceilMonth() : CarbonInterface
- ceilMonths() : CarbonInterface
- ceilQuarter() : CarbonInterface
- ceilQuarters() : CarbonInterface
- ceilSecond() : CarbonInterface
- ceilSeconds() : CarbonInterface
- ceilYear() : CarbonInterface
- ceilYears() : CarbonInterface
- centuriesInMillennium() : int
- centuriesUntil() : CarbonPeriod
- centuryOfMillennium() : int|static
- clone() : static
- copy() : static
- Get a copy of the instance.
- day() : CarbonInterface
- dayOfCentury() : int|static
- dayOfDecade() : int|static
- dayOfMillennium() : int|static
- dayOfMonth() : int|static
- dayOfQuarter() : int|static
- dayOfWeek() : int|static
- dayOfYear() : static|int
- Get/set the day of year.
- days() : CarbonInterface
- daysInCentury() : int
- daysInDecade() : int
- daysInMillennium() : int
- daysInMonth() : int
- daysInQuarter() : int
- daysInWeek() : int
- daysInYear() : int
- daysUntil() : CarbonPeriod
- decadeOfCentury() : int|static
- decadeOfMillennium() : int|static
- decadesInCentury() : int
- decadesInMillennium() : int
- decadesUntil() : CarbonPeriod
- diffInUTCCenturies() : float
- diffInUTCDays() : float
- diffInUTCDecades() : float
- diffInUTCHours() : float
- diffInUTCMicros() : float
- diffInUTCMicroseconds() : float
- diffInUTCMillennia() : float
- diffInUTCMillis() : float
- diffInUTCMilliseconds() : float
- diffInUTCMinutes() : float
- diffInUTCMonths() : float
- diffInUTCQuarters() : float
- diffInUTCSeconds() : float
- diffInUTCWeeks() : float
- diffInUTCYears() : float
- floorCenturies() : CarbonInterface
- floorCentury() : CarbonInterface
- floorDay() : CarbonInterface
- floorDays() : CarbonInterface
- floorDecade() : CarbonInterface
- floorDecades() : CarbonInterface
- floorHour() : CarbonInterface
- floorHours() : CarbonInterface
- floorMicrosecond() : CarbonInterface
- floorMicroseconds() : CarbonInterface
- floorMillennia() : CarbonInterface
- floorMillennium() : CarbonInterface
- floorMillisecond() : CarbonInterface
- floorMilliseconds() : CarbonInterface
- floorMinute() : CarbonInterface
- floorMinutes() : CarbonInterface
- floorMonth() : CarbonInterface
- floorMonths() : CarbonInterface
- floorQuarter() : CarbonInterface
- floorQuarters() : CarbonInterface
- floorSecond() : CarbonInterface
- floorSeconds() : CarbonInterface
- floorYear() : CarbonInterface
- floorYears() : CarbonInterface
- get() : string|int|bool|DateTimeZone
- Get a part of the Carbon object.
- getAltNumber() : string
- Returns the alternative number for a given date property if available in the current locale.
- getCalendarFormats() : array<string|int, mixed>
- Returns list of calendar formats for ISO formatting.
- getDays() : array<string|int, mixed>
- Get the days of the week.
- getDaysFromStartOfWeek() : int
- Return the number of days since the start of the week (using the current locale or the first parameter if explicitly given).
- getFormatsToIsoReplacements() : array<string|int, mixed>
- List of replacements from date() format to isoFormat().
- getIsoFormats() : array<string|int, mixed>
- Returns list of locale formats for ISO formatting.
- getIsoUnits() : array<string|int, mixed>
- Returns list of locale units for ISO formatting.
- getOffsetString() : string
- Returns the offset hour and minute formatted with +/- and a given separator (":" by default).
- getPaddedUnit() : string
- Returns a unit of the instance padded with 0 by default or any other string if specified.
- getTimezone() : CarbonTimeZone
- Get the TimeZone associated with the Carbon instance (as CarbonTimeZone).
- getTranslatedDayName() : string
- Get the translation of the current week day name (with context for languages with multiple forms).
- getTranslatedMinDayName() : string
- Get the translation of the current abbreviated week day name (with context for languages with multiple forms).
- getTranslatedMonthName() : string
- Get the translation of the current month day name (with context for languages with multiple forms).
- getTranslatedShortDayName() : string
- Get the translation of the current short week day name (with context for languages with multiple forms).
- getTranslatedShortMonthName() : string
- Get the translation of the current short month day name (with context for languages with multiple forms).
- getWeekendDays() : array<string|int, mixed>
- Get weekend days
- getWeekEndsAt() : int
- Get the last day of week.
- getWeekStartsAt() : int
- Get the first day of week.
- hasRelativeKeywords() : bool
- Determine if a time string will produce a relative date.
- hour() : CarbonInterface
- hourOfCentury() : int|static
- hourOfDay() : int|static
- hourOfDecade() : int|static
- hourOfMillennium() : int|static
- hourOfMonth() : int|static
- hourOfQuarter() : int|static
- hourOfWeek() : int|static
- hourOfYear() : int|static
- hours() : CarbonInterface
- hoursInCentury() : int
- hoursInDay() : int
- hoursInDecade() : int
- hoursInMillennium() : int
- hoursInMonth() : int
- hoursInQuarter() : int
- hoursInWeek() : int
- hoursInYear() : int
- hoursUntil() : CarbonPeriod
- isCurrentCentury() : bool
- isCurrentDay() : bool
- isCurrentDecade() : bool
- isCurrentHour() : bool
- isCurrentMicro() : bool
- isCurrentMicrosecond() : bool
- isCurrentMillennium() : bool
- isCurrentMilli() : bool
- isCurrentMillisecond() : bool
- isCurrentMinute() : bool
- isCurrentMonth() : bool
- isCurrentQuarter() : bool
- isCurrentSecond() : bool
- isCurrentWeek() : bool
- isCurrentYear() : bool
- isDST() : bool
- isFriday() : bool
- isLastCentury() : bool
- isLastDay() : bool
- isLastDecade() : bool
- isLastHour() : bool
- isLastMicro() : bool
- isLastMicrosecond() : bool
- isLastMillennium() : bool
- isLastMilli() : bool
- isLastMillisecond() : bool
- isLastMinute() : bool
- isLastMonth() : bool
- isLastQuarter() : bool
- isLastSecond() : bool
- isLastWeek() : bool
- isLastYear() : bool
- isLocal() : bool
- isMonday() : bool
- isNextCentury() : bool
- isNextDay() : bool
- isNextDecade() : bool
- isNextHour() : bool
- isNextMicro() : bool
- isNextMicrosecond() : bool
- isNextMillennium() : bool
- isNextMilli() : bool
- isNextMillisecond() : bool
- isNextMinute() : bool
- isNextMonth() : bool
- isNextQuarter() : bool
- isNextSecond() : bool
- isNextWeek() : bool
- isNextYear() : bool
- isoFormat() : string
- Format in the current language using ISO replacement patterns.
- isoWeekday() : static|int
- Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
- isSameCentury() : bool
- isSameDay() : bool
- isSameDecade() : bool
- isSameHour() : bool
- isSameMicro() : bool
- isSameMicrosecond() : bool
- isSameMillennium() : bool
- isSameMilli() : bool
- isSameMillisecond() : bool
- isSameMinute() : bool
- isSameSecond() : bool
- isSameWeek() : bool
- isSameYear() : bool
- isSaturday() : bool
- isSunday() : bool
- isThursday() : bool
- isTuesday() : bool
- isUtc() : bool
- isValid() : bool
- isWednesday() : bool
- longAbsoluteDiffForHumans() : string
- longRelativeDiffForHumans() : string
- longRelativeToNowDiffForHumans() : string
- longRelativeToOtherDiffForHumans() : string
- meridiem() : string
- Return the meridiem of the current time in the current locale.
- micro() : CarbonInterface
- micros() : CarbonInterface
- microsecond() : CarbonInterface
- microsecondOfCentury() : int|static
- microsecondOfDay() : int|static
- microsecondOfDecade() : int|static
- microsecondOfHour() : int|static
- microsecondOfMillennium() : int|static
- microsecondOfMillisecond() : int|static
- microsecondOfMinute() : int|static
- microsecondOfMonth() : int|static
- microsecondOfQuarter() : int|static
- microsecondOfSecond() : int|static
- microsecondOfWeek() : int|static
- microsecondOfYear() : int|static
- microseconds() : CarbonInterface
- microsecondsInCentury() : int
- microsecondsInDay() : int
- microsecondsInDecade() : int
- microsecondsInHour() : int
- microsecondsInMillennium() : int
- microsecondsInMillisecond() : int
- microsecondsInMinute() : int
- microsecondsInMonth() : int
- microsecondsInQuarter() : int
- microsecondsInSecond() : int
- microsecondsInWeek() : int
- microsecondsInYear() : int
- microsecondsUntil() : CarbonPeriod
- microsUntil() : CarbonPeriod
- millenniaUntil() : CarbonPeriod
- milli() : CarbonInterface
- millis() : CarbonInterface
- millisecond() : CarbonInterface
- millisecondOfCentury() : int|static
- millisecondOfDay() : int|static
- millisecondOfDecade() : int|static
- millisecondOfHour() : int|static
- millisecondOfMillennium() : int|static
- millisecondOfMinute() : int|static
- millisecondOfMonth() : int|static
- millisecondOfQuarter() : int|static
- millisecondOfSecond() : int|static
- millisecondOfWeek() : int|static
- millisecondOfYear() : int|static
- milliseconds() : CarbonInterface
- millisecondsInCentury() : int
- millisecondsInDay() : int
- millisecondsInDecade() : int
- millisecondsInHour() : int
- millisecondsInMillennium() : int
- millisecondsInMinute() : int
- millisecondsInMonth() : int
- millisecondsInQuarter() : int
- millisecondsInSecond() : int
- millisecondsInWeek() : int
- millisecondsInYear() : int
- millisecondsUntil() : CarbonPeriod
- millisUntil() : CarbonPeriod
- minute() : CarbonInterface
- minuteOfCentury() : int|static
- minuteOfDay() : int|static
- minuteOfDecade() : int|static
- minuteOfHour() : int|static
- minuteOfMillennium() : int|static
- minuteOfMonth() : int|static
- minuteOfQuarter() : int|static
- minuteOfWeek() : int|static
- minuteOfYear() : int|static
- minutes() : CarbonInterface
- minutesInCentury() : int
- minutesInDay() : int
- minutesInDecade() : int
- minutesInHour() : int
- minutesInMillennium() : int
- minutesInMonth() : int
- minutesInQuarter() : int
- minutesInWeek() : int
- minutesInYear() : int
- minutesUntil() : CarbonPeriod
- month() : CarbonInterface
- monthOfCentury() : int|static
- monthOfDecade() : int|static
- monthOfMillennium() : int|static
- monthOfQuarter() : int|static
- monthOfYear() : int|static
- months() : CarbonInterface
- monthsInCentury() : int
- monthsInDecade() : int
- monthsInMillennium() : int
- monthsInQuarter() : int
- monthsInYear() : int
- monthsUntil() : CarbonPeriod
- nowWithSameTz() : static
- Returns a present instance in the same timezone.
- ordinal() : string
- Return a property with its ordinal.
- pluralUnit() : string
- Returns standardized plural of a given singular/plural unit name (in English).
- quarterOfCentury() : int|static
- quarterOfDecade() : int|static
- quarterOfMillennium() : int|static
- quarterOfYear() : int|static
- quartersInCentury() : int
- quartersInDecade() : int
- quartersInMillennium() : int
- quartersInYear() : int
- quartersUntil() : CarbonPeriod
- roundCenturies() : CarbonInterface
- roundCentury() : CarbonInterface
- roundDay() : CarbonInterface
- roundDays() : CarbonInterface
- roundDecade() : CarbonInterface
- roundDecades() : CarbonInterface
- roundHour() : CarbonInterface
- roundHours() : CarbonInterface
- roundMicrosecond() : CarbonInterface
- roundMicroseconds() : CarbonInterface
- roundMillennia() : CarbonInterface
- roundMillennium() : CarbonInterface
- roundMillisecond() : CarbonInterface
- roundMilliseconds() : CarbonInterface
- roundMinute() : CarbonInterface
- roundMinutes() : CarbonInterface
- roundMonth() : CarbonInterface
- roundMonths() : CarbonInterface
- roundQuarter() : CarbonInterface
- roundQuarters() : CarbonInterface
- roundSecond() : CarbonInterface
- roundSeconds() : CarbonInterface
- roundYear() : CarbonInterface
- roundYears() : CarbonInterface
- second() : CarbonInterface
- secondOfCentury() : int|static
- secondOfDay() : int|static
- secondOfDecade() : int|static
- secondOfHour() : int|static
- secondOfMillennium() : int|static
- secondOfMinute() : int|static
- secondOfMonth() : int|static
- secondOfQuarter() : int|static
- secondOfWeek() : int|static
- secondOfYear() : int|static
- seconds() : CarbonInterface
- secondsInCentury() : int
- secondsInDay() : int
- secondsInDecade() : int
- secondsInHour() : int
- secondsInMillennium() : int
- secondsInMinute() : int
- secondsInMonth() : int
- secondsInQuarter() : int
- secondsInWeek() : int
- secondsInYear() : int
- secondsUntil() : CarbonPeriod
- set() : $this
- Set a part of the Carbon object.
- setDate() : static
- Set the date with gregorian year, month and day numbers.
- setDateFrom() : static
- Set the year, month, and date for this instance to that of the passed instance.
- setDateTime() : static
- Set the date and time all together.
- setDateTimeFrom() : static
- Set the date and time for this instance to that of the passed instance.
- setDay() : CarbonInterface
- setDays() : CarbonInterface
- setDaysFromStartOfWeek() : static
- Set the day (keeping the current time) to the start of the week + the number of days passed as the first parameter. First day of week is driven by the locale unless explicitly set with the second parameter.
- setHour() : CarbonInterface
- setHours() : CarbonInterface
- setISODate() : static
- Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
- setMicro() : CarbonInterface
- setMicros() : CarbonInterface
- setMicrosecond() : CarbonInterface
- setMicroseconds() : CarbonInterface
- setMilli() : CarbonInterface
- setMillis() : CarbonInterface
- setMillisecond() : CarbonInterface
- setMilliseconds() : CarbonInterface
- setMinute() : CarbonInterface
- setMinutes() : CarbonInterface
- setMonth() : CarbonInterface
- setMonths() : CarbonInterface
- setSecond() : CarbonInterface
- setSeconds() : CarbonInterface
- setTime() : static
- Resets the current time of the DateTime object to a different time.
- setTimeFrom() : static
- Set the hour, minute, second and microseconds for this instance to that of the passed instance.
- setTimeFromTimeString() : static
- Set the time by time string.
- setTimestamp() : static
- Set the instance's timestamp.
- setTimezone() : static
- Set the instance's timezone from a string or object.
- setUnit() : static
- Set specified unit to new given value.
- setUnitNoOverflow() : static
- Set any unit to a new value without overflowing current other unit given.
- setWeekendDays() : void
- setYear() : CarbonInterface
- setYears() : CarbonInterface
- shiftTimezone() : static
- Set the instance's timezone from a string or object and add/subtract the offset difference.
- shortAbsoluteDiffForHumans() : string
- shortRelativeDiffForHumans() : string
- shortRelativeToNowDiffForHumans() : string
- shortRelativeToOtherDiffForHumans() : string
- singularUnit() : string
- Returns standardized singular of a given singular/plural unit name (in English).
- sleep() : void
- subCenturies() : CarbonInterface
- subCenturiesNoOverflow() : CarbonInterface
- subCenturiesWithNoOverflow() : CarbonInterface
- subCenturiesWithoutOverflow() : CarbonInterface
- subCenturiesWithOverflow() : CarbonInterface
- subCentury() : CarbonInterface
- subCenturyNoOverflow() : CarbonInterface
- subCenturyWithNoOverflow() : CarbonInterface
- subCenturyWithoutOverflow() : CarbonInterface
- subCenturyWithOverflow() : CarbonInterface
- subDay() : CarbonInterface
- subDays() : CarbonInterface
- subDecade() : CarbonInterface
- subDecadeNoOverflow() : CarbonInterface
- subDecades() : CarbonInterface
- subDecadesNoOverflow() : CarbonInterface
- subDecadesWithNoOverflow() : CarbonInterface
- subDecadesWithoutOverflow() : CarbonInterface
- subDecadesWithOverflow() : CarbonInterface
- subDecadeWithNoOverflow() : CarbonInterface
- subDecadeWithoutOverflow() : CarbonInterface
- subDecadeWithOverflow() : CarbonInterface
- subHour() : CarbonInterface
- subHours() : CarbonInterface
- subMicro() : CarbonInterface
- subMicros() : CarbonInterface
- subMicrosecond() : CarbonInterface
- subMicroseconds() : CarbonInterface
- subMillennia() : CarbonInterface
- subMillenniaNoOverflow() : CarbonInterface
- subMillenniaWithNoOverflow() : CarbonInterface
- subMillenniaWithoutOverflow() : CarbonInterface
- subMillenniaWithOverflow() : CarbonInterface
- subMillennium() : CarbonInterface
- subMillenniumNoOverflow() : CarbonInterface
- subMillenniumWithNoOverflow() : CarbonInterface
- subMillenniumWithoutOverflow() : CarbonInterface
- subMillenniumWithOverflow() : CarbonInterface
- subMilli() : CarbonInterface
- subMillis() : CarbonInterface
- subMillisecond() : CarbonInterface
- subMilliseconds() : CarbonInterface
- subMinute() : CarbonInterface
- subMinutes() : CarbonInterface
- subMonth() : CarbonInterface
- subMonthNoOverflow() : CarbonInterface
- subMonths() : CarbonInterface
- subMonthsNoOverflow() : CarbonInterface
- subMonthsWithNoOverflow() : CarbonInterface
- subMonthsWithoutOverflow() : CarbonInterface
- subMonthsWithOverflow() : CarbonInterface
- subMonthWithNoOverflow() : CarbonInterface
- subMonthWithoutOverflow() : CarbonInterface
- subMonthWithOverflow() : CarbonInterface
- subQuarter() : CarbonInterface
- subQuarterNoOverflow() : CarbonInterface
- subQuarters() : CarbonInterface
- subQuartersNoOverflow() : CarbonInterface
- subQuartersWithNoOverflow() : CarbonInterface
- subQuartersWithoutOverflow() : CarbonInterface
- subQuartersWithOverflow() : CarbonInterface
- subQuarterWithNoOverflow() : CarbonInterface
- subQuarterWithoutOverflow() : CarbonInterface
- subQuarterWithOverflow() : CarbonInterface
- subSecond() : CarbonInterface
- subSeconds() : CarbonInterface
- subUnitNoOverflow() : static
- Subtract any unit to a new value without overflowing current other unit given.
- subUTCCenturies() : CarbonInterface
- subUTCCentury() : CarbonInterface
- subUTCDay() : CarbonInterface
- subUTCDays() : CarbonInterface
- subUTCDecade() : CarbonInterface
- subUTCDecades() : CarbonInterface
- subUTCHour() : CarbonInterface
- subUTCHours() : CarbonInterface
- subUTCMicro() : CarbonInterface
- subUTCMicros() : CarbonInterface
- subUTCMicrosecond() : CarbonInterface
- subUTCMicroseconds() : CarbonInterface
- subUTCMillennia() : CarbonInterface
- subUTCMillennium() : CarbonInterface
- subUTCMilli() : CarbonInterface
- subUTCMillis() : CarbonInterface
- subUTCMillisecond() : CarbonInterface
- subUTCMilliseconds() : CarbonInterface
- subUTCMinute() : CarbonInterface
- subUTCMinutes() : CarbonInterface
- subUTCMonth() : CarbonInterface
- subUTCMonths() : CarbonInterface
- subUTCQuarter() : CarbonInterface
- subUTCQuarters() : CarbonInterface
- subUTCSecond() : CarbonInterface
- subUTCSeconds() : CarbonInterface
- subUTCWeek() : CarbonInterface
- subUTCWeeks() : CarbonInterface
- subUTCYear() : CarbonInterface
- subUTCYears() : CarbonInterface
- subWeek() : CarbonInterface
- subWeekday() : CarbonInterface
- subWeekdays() : CarbonInterface
- subWeeks() : CarbonInterface
- subYear() : CarbonInterface
- subYearNoOverflow() : CarbonInterface
- subYears() : CarbonInterface
- subYearsNoOverflow() : CarbonInterface
- subYearsWithNoOverflow() : CarbonInterface
- subYearsWithoutOverflow() : CarbonInterface
- subYearsWithOverflow() : CarbonInterface
- subYearWithNoOverflow() : CarbonInterface
- subYearWithoutOverflow() : CarbonInterface
- subYearWithOverflow() : CarbonInterface
- timezone() : static
- translatedFormat() : string
- Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) but translate words whenever possible (months, day names, etc.) using the current locale.
- tz() : static|string
- Set the timezone or returns the timezone name if no arguments passed.
- utc() : static
- Set the instance's timezone to UTC.
- utcOffset() : static|int
- Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
- weekday() : static|int
- Get/set the weekday from 0 (Sunday) to 6 (Saturday).
- weekOfCentury() : int|static
- weekOfDecade() : int|static
- weekOfMillennium() : int|static
- weekOfMonth() : int|static
- weekOfQuarter() : int|static
- weekOfYear() : int|static
- weeksInCentury() : int
- weeksInDecade() : int
- weeksInMillennium() : int
- weeksInMonth() : int
- weeksInQuarter() : int
- weeksUntil() : CarbonPeriod
- year() : CarbonInterface
- yearOfCentury() : int|static
- yearOfDecade() : int|static
- yearOfMillennium() : int|static
- years() : CarbonInterface
- yearsInCentury() : int
- yearsInDecade() : int
- yearsInMillennium() : int
- yearsUntil() : CarbonPeriod
- executeCallable() : mixed
- executeCallableWithContext() : mixed
- executeStaticCallable() : mixed
- getAllGenericMacros() : Generator
- getGenericMacros() : Generator
- getRangesByUnit() : array<string|int, mixed>
- List of minimum and maximums for each unit.
- getTranslatedFormByRegExp() : mixed
- resolveCarbon() : self
- Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
- safeCreateDateTimeZone() : CarbonTimeZone|null
- Creates a DateTimeZone from a string, DateTimeZone or integer offset.
- weekRotate() : int
- callComparatorMethod() : bool|null
- callDiffAlias() : mixed
- callGetOrSet() : mixed
- callGetOrSetMethod() : mixed
- callHumanDiffAlias() : string|null
- callIsMethod() : bool|null
- callMacroMethod() : mixed
- callModifierMethod() : static|null
- callPeriodMethod() : CarbonPeriod|null
- floorZeroPad() : string
- getUTCUnit() : string|null
Properties
$age
public
int
$age
does a diffInYears() with default parameters
$centuriesInMillennium
public
int
$centuriesInMillennium
The number of centuries contained in the current millennium
$century
public
int
$century
the century of this instance
$centuryOfMillennium
public
int
$centuryOfMillennium
The value of the century starting from the beginning of the current millennium
$day
public
int
$day
$dayName
public
string
$dayName
long name of weekday translated according to Carbon locale, in english if no translation available for current language
$dayOfCentury
public
int
$dayOfCentury
The value of the day starting from the beginning of the current century
$dayOfDecade
public
int
$dayOfDecade
The value of the day starting from the beginning of the current decade
$dayOfMillennium
public
int
$dayOfMillennium
The value of the day starting from the beginning of the current millennium
$dayOfMonth
public
int
$dayOfMonth
The value of the day starting from the beginning of the current month
$dayOfQuarter
public
int
$dayOfQuarter
The value of the day starting from the beginning of the current quarter
$dayOfWeek
public
int
$dayOfWeek
0 (for Sunday) through 6 (for Saturday)
$dayOfWeekIso
public
int
$dayOfWeekIso
1 (for Monday) through 7 (for Sunday)
$dayOfYear
public
int
$dayOfYear
1 through 366
$daysInCentury
public
int
$daysInCentury
The number of days contained in the current century
$daysInDecade
public
int
$daysInDecade
The number of days contained in the current decade
$daysInMillennium
public
int
$daysInMillennium
The number of days contained in the current millennium
$daysInMonth
public
int
$daysInMonth
number of days in the given month
$daysInQuarter
public
int
$daysInQuarter
The number of days contained in the current quarter
$daysInWeek
public
int
$daysInWeek
The number of days contained in the current week
$daysInYear
public
int
$daysInYear
365 or 366
$decade
public
int
$decade
the decade of this instance
$decadeOfCentury
public
int
$decadeOfCentury
The value of the decade starting from the beginning of the current century
$decadeOfMillennium
public
int
$decadeOfMillennium
The value of the decade starting from the beginning of the current millennium
$decadesInCentury
public
int
$decadesInCentury
The number of decades contained in the current century
$decadesInMillennium
public
int
$decadesInMillennium
The number of decades contained in the current millennium
$dst
public
bool
$dst
daylight savings time indicator, true if DST, false otherwise
$englishDayOfWeek
public
string
$englishDayOfWeek
the day of week in English
$englishMonth
public
string
$englishMonth
the month in English
$firstWeekDay
public
int
$firstWeekDay
0 through 6
$hour
public
int
$hour
$hourOfCentury
public
int
$hourOfCentury
The value of the hour starting from the beginning of the current century
$hourOfDay
public
int
$hourOfDay
The value of the hour starting from the beginning of the current day
$hourOfDecade
public
int
$hourOfDecade
The value of the hour starting from the beginning of the current decade
$hourOfMillennium
public
int
$hourOfMillennium
The value of the hour starting from the beginning of the current millennium
$hourOfMonth
public
int
$hourOfMonth
The value of the hour starting from the beginning of the current month
$hourOfQuarter
public
int
$hourOfQuarter
The value of the hour starting from the beginning of the current quarter
$hourOfWeek
public
int
$hourOfWeek
The value of the hour starting from the beginning of the current week
$hourOfYear
public
int
$hourOfYear
The value of the hour starting from the beginning of the current year
$hoursInCentury
public
int
$hoursInCentury
The number of hours contained in the current century
$hoursInDay
public
int
$hoursInDay
The number of hours contained in the current day
$hoursInDecade
public
int
$hoursInDecade
The number of hours contained in the current decade
$hoursInMillennium
public
int
$hoursInMillennium
The number of hours contained in the current millennium
$hoursInMonth
public
int
$hoursInMonth
The number of hours contained in the current month
$hoursInQuarter
public
int
$hoursInQuarter
The number of hours contained in the current quarter
$hoursInWeek
public
int
$hoursInWeek
The number of hours contained in the current week
$hoursInYear
public
int
$hoursInYear
The number of hours contained in the current year
$isoWeek
public
int
$isoWeek
1 through 53
$isoWeeksInYear
public
int
$isoWeeksInYear
51 through 53
$isoWeekYear
public
int
$isoWeekYear
year according to ISO week format
$lastWeekDay
public
int
$lastWeekDay
0 through 6
$latinMeridiem
public
string
$latinMeridiem
"am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
$latinUpperMeridiem
public
string
$latinUpperMeridiem
"AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
$local
public
bool
$local
checks if the timezone is local, true if local, false otherwise
$locale
public
string
$locale
locale of the current instance
$localeDayOfWeek
public
string
$localeDayOfWeek
the day of week in current locale
$localeMonth
public
string
$localeMonth
the month in current locale
$meridiem
public
string
$meridiem
lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
$micro
public
int
$micro
$microsecond
public
int
$microsecond
$microsecondOfCentury
public
int
$microsecondOfCentury
The value of the microsecond starting from the beginning of the current century
$microsecondOfDay
public
int
$microsecondOfDay
The value of the microsecond starting from the beginning of the current day
$microsecondOfDecade
public
int
$microsecondOfDecade
The value of the microsecond starting from the beginning of the current decade
$microsecondOfHour
public
int
$microsecondOfHour
The value of the microsecond starting from the beginning of the current hour
$microsecondOfMillennium
public
int
$microsecondOfMillennium
The value of the microsecond starting from the beginning of the current millennium
$microsecondOfMillisecond
public
int
$microsecondOfMillisecond
The value of the microsecond starting from the beginning of the current millisecond
$microsecondOfMinute
public
int
$microsecondOfMinute
The value of the microsecond starting from the beginning of the current minute
$microsecondOfMonth
public
int
$microsecondOfMonth
The value of the microsecond starting from the beginning of the current month
$microsecondOfQuarter
public
int
$microsecondOfQuarter
The value of the microsecond starting from the beginning of the current quarter
$microsecondOfSecond
public
int
$microsecondOfSecond
The value of the microsecond starting from the beginning of the current second
$microsecondOfWeek
public
int
$microsecondOfWeek
The value of the microsecond starting from the beginning of the current week
$microsecondOfYear
public
int
$microsecondOfYear
The value of the microsecond starting from the beginning of the current year
$microsecondsInCentury
public
int
$microsecondsInCentury
The number of microseconds contained in the current century
$microsecondsInDay
public
int
$microsecondsInDay
The number of microseconds contained in the current day
$microsecondsInDecade
public
int
$microsecondsInDecade
The number of microseconds contained in the current decade
$microsecondsInHour
public
int
$microsecondsInHour
The number of microseconds contained in the current hour
$microsecondsInMillennium
public
int
$microsecondsInMillennium
The number of microseconds contained in the current millennium
$microsecondsInMillisecond
public
int
$microsecondsInMillisecond
The number of microseconds contained in the current millisecond
$microsecondsInMinute
public
int
$microsecondsInMinute
The number of microseconds contained in the current minute
$microsecondsInMonth
public
int
$microsecondsInMonth
The number of microseconds contained in the current month
$microsecondsInQuarter
public
int
$microsecondsInQuarter
The number of microseconds contained in the current quarter
$microsecondsInSecond
public
int
$microsecondsInSecond
The number of microseconds contained in the current second
$microsecondsInWeek
public
int
$microsecondsInWeek
The number of microseconds contained in the current week
$microsecondsInYear
public
int
$microsecondsInYear
The number of microseconds contained in the current year
$millennium
public
int
$millennium
the millennium of this instance
$milli
public
int
$milli
$millisecond
public
int
$millisecond
$millisecondOfCentury
public
int
$millisecondOfCentury
The value of the millisecond starting from the beginning of the current century
$millisecondOfDay
public
int
$millisecondOfDay
The value of the millisecond starting from the beginning of the current day
$millisecondOfDecade
public
int
$millisecondOfDecade
The value of the millisecond starting from the beginning of the current decade
$millisecondOfHour
public
int
$millisecondOfHour
The value of the millisecond starting from the beginning of the current hour
$millisecondOfMillennium
public
int
$millisecondOfMillennium
The value of the millisecond starting from the beginning of the current millennium
$millisecondOfMinute
public
int
$millisecondOfMinute
The value of the millisecond starting from the beginning of the current minute
$millisecondOfMonth
public
int
$millisecondOfMonth
The value of the millisecond starting from the beginning of the current month
$millisecondOfQuarter
public
int
$millisecondOfQuarter
The value of the millisecond starting from the beginning of the current quarter
$millisecondOfSecond
public
int
$millisecondOfSecond
The value of the millisecond starting from the beginning of the current second
$millisecondOfWeek
public
int
$millisecondOfWeek
The value of the millisecond starting from the beginning of the current week
$millisecondOfYear
public
int
$millisecondOfYear
The value of the millisecond starting from the beginning of the current year
$milliseconds
public
int
$milliseconds
$millisecondsInCentury
public
int
$millisecondsInCentury
The number of milliseconds contained in the current century
$millisecondsInDay
public
int
$millisecondsInDay
The number of milliseconds contained in the current day
$millisecondsInDecade
public
int
$millisecondsInDecade
The number of milliseconds contained in the current decade
$millisecondsInHour
public
int
$millisecondsInHour
The number of milliseconds contained in the current hour
$millisecondsInMillennium
public
int
$millisecondsInMillennium
The number of milliseconds contained in the current millennium
$millisecondsInMinute
public
int
$millisecondsInMinute
The number of milliseconds contained in the current minute
$millisecondsInMonth
public
int
$millisecondsInMonth
The number of milliseconds contained in the current month
$millisecondsInQuarter
public
int
$millisecondsInQuarter
The number of milliseconds contained in the current quarter
$millisecondsInSecond
public
int
$millisecondsInSecond
The number of milliseconds contained in the current second
$millisecondsInWeek
public
int
$millisecondsInWeek
The number of milliseconds contained in the current week
$millisecondsInYear
public
int
$millisecondsInYear
The number of milliseconds contained in the current year
$minDayName
public
string
$minDayName
very short name of weekday translated according to Carbon locale, in english if no translation available for current language
$minute
public
int
$minute
$minuteOfCentury
public
int
$minuteOfCentury
The value of the minute starting from the beginning of the current century
$minuteOfDay
public
int
$minuteOfDay
The value of the minute starting from the beginning of the current day
$minuteOfDecade
public
int
$minuteOfDecade
The value of the minute starting from the beginning of the current decade
$minuteOfHour
public
int
$minuteOfHour
The value of the minute starting from the beginning of the current hour
$minuteOfMillennium
public
int
$minuteOfMillennium
The value of the minute starting from the beginning of the current millennium
$minuteOfMonth
public
int
$minuteOfMonth
The value of the minute starting from the beginning of the current month
$minuteOfQuarter
public
int
$minuteOfQuarter
The value of the minute starting from the beginning of the current quarter
$minuteOfWeek
public
int
$minuteOfWeek
The value of the minute starting from the beginning of the current week
$minuteOfYear
public
int
$minuteOfYear
The value of the minute starting from the beginning of the current year
$minutesInCentury
public
int
$minutesInCentury
The number of minutes contained in the current century
$minutesInDay
public
int
$minutesInDay
The number of minutes contained in the current day
$minutesInDecade
public
int
$minutesInDecade
The number of minutes contained in the current decade
$minutesInHour
public
int
$minutesInHour
The number of minutes contained in the current hour
$minutesInMillennium
public
int
$minutesInMillennium
The number of minutes contained in the current millennium
$minutesInMonth
public
int
$minutesInMonth
The number of minutes contained in the current month
$minutesInQuarter
public
int
$minutesInQuarter
The number of minutes contained in the current quarter
$minutesInWeek
public
int
$minutesInWeek
The number of minutes contained in the current week
$minutesInYear
public
int
$minutesInYear
The number of minutes contained in the current year
$month
public
int
$month
$monthName
public
string
$monthName
long name of month translated according to Carbon locale, in english if no translation available for current language
$monthOfCentury
public
int
$monthOfCentury
The value of the month starting from the beginning of the current century
$monthOfDecade
public
int
$monthOfDecade
The value of the month starting from the beginning of the current decade
$monthOfMillennium
public
int
$monthOfMillennium
The value of the month starting from the beginning of the current millennium
$monthOfQuarter
public
int
$monthOfQuarter
The value of the month starting from the beginning of the current quarter
$monthOfYear
public
int
$monthOfYear
The value of the month starting from the beginning of the current year
$monthsInCentury
public
int
$monthsInCentury
The number of months contained in the current century
$monthsInDecade
public
int
$monthsInDecade
The number of months contained in the current decade
$monthsInMillennium
public
int
$monthsInMillennium
The number of months contained in the current millennium
$monthsInQuarter
public
int
$monthsInQuarter
The number of months contained in the current quarter
$monthsInYear
public
int
$monthsInYear
The number of months contained in the current year
$noZeroHour
public
int
$noZeroHour
current hour from 1 to 24
$offset
public
int
$offset
the timezone offset in seconds from UTC
$offsetHours
public
int
$offsetHours
the timezone offset in hours from UTC
$offsetMinutes
public
int
$offsetMinutes
the timezone offset in minutes from UTC
$quarter
public
int
$quarter
the quarter of this instance, 1 - 4
$quarterOfCentury
public
int
$quarterOfCentury
The value of the quarter starting from the beginning of the current century
$quarterOfDecade
public
int
$quarterOfDecade
The value of the quarter starting from the beginning of the current decade
$quarterOfMillennium
public
int
$quarterOfMillennium
The value of the quarter starting from the beginning of the current millennium
$quarterOfYear
public
int
$quarterOfYear
The value of the quarter starting from the beginning of the current year
$quartersInCentury
public
int
$quartersInCentury
The number of quarters contained in the current century
$quartersInDecade
public
int
$quartersInDecade
The number of quarters contained in the current decade
$quartersInMillennium
public
int
$quartersInMillennium
The number of quarters contained in the current millennium
$quartersInYear
public
int
$quartersInYear
The number of quarters contained in the current year
$second
public
int
$second
$secondOfCentury
public
int
$secondOfCentury
The value of the second starting from the beginning of the current century
$secondOfDay
public
int
$secondOfDay
The value of the second starting from the beginning of the current day
$secondOfDecade
public
int
$secondOfDecade
The value of the second starting from the beginning of the current decade
$secondOfHour
public
int
$secondOfHour
The value of the second starting from the beginning of the current hour
$secondOfMillennium
public
int
$secondOfMillennium
The value of the second starting from the beginning of the current millennium
$secondOfMinute
public
int
$secondOfMinute
The value of the second starting from the beginning of the current minute
$secondOfMonth
public
int
$secondOfMonth
The value of the second starting from the beginning of the current month
$secondOfQuarter
public
int
$secondOfQuarter
The value of the second starting from the beginning of the current quarter
$secondOfWeek
public
int
$secondOfWeek
The value of the second starting from the beginning of the current week
$secondOfYear
public
int
$secondOfYear
The value of the second starting from the beginning of the current year
$secondsInCentury
public
int
$secondsInCentury
The number of seconds contained in the current century
$secondsInDay
public
int
$secondsInDay
The number of seconds contained in the current day
$secondsInDecade
public
int
$secondsInDecade
The number of seconds contained in the current decade
$secondsInHour
public
int
$secondsInHour
The number of seconds contained in the current hour
$secondsInMillennium
public
int
$secondsInMillennium
The number of seconds contained in the current millennium
$secondsInMinute
public
int
$secondsInMinute
The number of seconds contained in the current minute
$secondsInMonth
public
int
$secondsInMonth
The number of seconds contained in the current month
$secondsInQuarter
public
int
$secondsInQuarter
The number of seconds contained in the current quarter
$secondsInWeek
public
int
$secondsInWeek
The number of seconds contained in the current week
$secondsInYear
public
int
$secondsInYear
The number of seconds contained in the current year
$shortDayName
public
string
$shortDayName
short name of weekday translated according to Carbon locale, in english if no translation available for current language
$shortEnglishDayOfWeek
public
string
$shortEnglishDayOfWeek
the abbreviated day of week in English
$shortEnglishMonth
public
string
$shortEnglishMonth
the abbreviated month in English
$shortLocaleDayOfWeek
public
string
$shortLocaleDayOfWeek
the abbreviated day of week in current locale
$shortLocaleMonth
public
string
$shortLocaleMonth
the abbreviated month in current locale
$shortMonthName
public
string
$shortMonthName
short name of month translated according to Carbon locale, in english if no translation available for current language
$timestamp
public
int|float|string
$timestamp
seconds since the Unix Epoch
$timezone
public
CarbonTimeZone
$timezone
the current timezone
$timezoneAbbreviatedName
public
string
$timezoneAbbreviatedName
the current timezone abbreviated name
$timezoneName
public
string
$timezoneName
the current timezone name
$tz
public
CarbonTimeZone
$tz
alias of $timezone
$tzAbbrName
public
string
$tzAbbrName
alias of $timezoneAbbreviatedName
$tzName
public
string
$tzName
alias of $timezoneName
$upperMeridiem
public
string
$upperMeridiem
uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
$utc
public
bool
$utc
checks if the timezone is UTC, true if UTC, false otherwise
$week
public
int
$week
1 through 53
$weekNumberInMonth
public
int
$weekNumberInMonth
1 through 5
$weekOfCentury
public
int
$weekOfCentury
The value of the week starting from the beginning of the current century
$weekOfDecade
public
int
$weekOfDecade
The value of the week starting from the beginning of the current decade
$weekOfMillennium
public
int
$weekOfMillennium
The value of the week starting from the beginning of the current millennium
$weekOfMonth
public
int
$weekOfMonth
1 through 5
$weekOfQuarter
public
int
$weekOfQuarter
The value of the week starting from the beginning of the current quarter
$weekOfYear
public
int
$weekOfYear
ISO-8601 week number of year, weeks starting on Monday
$weeksInCentury
public
int
$weeksInCentury
The number of weeks contained in the current century
$weeksInDecade
public
int
$weeksInDecade
The number of weeks contained in the current decade
$weeksInMillennium
public
int
$weeksInMillennium
The number of weeks contained in the current millennium
$weeksInMonth
public
int
$weeksInMonth
The number of weeks contained in the current month
$weeksInQuarter
public
int
$weeksInQuarter
The number of weeks contained in the current quarter
$weeksInYear
public
int
$weeksInYear
51 through 53
$weekYear
public
int
$weekYear
year according to week format
$year
public
int
$year
$yearIso
public
int
$yearIso
$yearOfCentury
public
int
$yearOfCentury
The value of the year starting from the beginning of the current century
$yearOfDecade
public
int
$yearOfDecade
The value of the year starting from the beginning of the current decade
$yearOfMillennium
public
int
$yearOfMillennium
The value of the year starting from the beginning of the current millennium
$yearsInCentury
public
int
$yearsInCentury
The number of years contained in the current century
$yearsInDecade
public
int
$yearsInDecade
The number of years contained in the current decade
$yearsInMillennium
public
int
$yearsInMillennium
The number of years contained in the current millennium
$days
Names of days of the week.
protected
static array<string|int, mixed>
$days
= [
// @call isDayOfWeek
\Carbon\CarbonInterface::SUNDAY => 'Sunday',
// @call isDayOfWeek
\Carbon\CarbonInterface::MONDAY => 'Monday',
// @call isDayOfWeek
\Carbon\CarbonInterface::TUESDAY => 'Tuesday',
// @call isDayOfWeek
\Carbon\CarbonInterface::WEDNESDAY => 'Wednesday',
// @call isDayOfWeek
\Carbon\CarbonInterface::THURSDAY => 'Thursday',
// @call isDayOfWeek
\Carbon\CarbonInterface::FRIDAY => 'Friday',
// @call isDayOfWeek
\Carbon\CarbonInterface::SATURDAY => 'Saturday',
]
$units
List of unit and magic methods associated as doc-comments.
protected
static array<string|int, mixed>
$units
= [
// @call setUnit
// @call addUnit
'year',
// @call setUnit
// @call addUnit
'month',
// @call setUnit
// @call addUnit
'day',
// @call setUnit
// @call addUnit
'hour',
// @call setUnit
// @call addUnit
'minute',
// @call setUnit
// @call addUnit
'second',
// @call setUnit
// @call addUnit
'milli',
// @call setUnit
// @call addUnit
'millisecond',
// @call setUnit
// @call addUnit
'micro',
// @call setUnit
// @call addUnit
'microsecond',
]
Methods
__call()
Dynamically handle calls to the class.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
-
magic method name called
- $parameters : array<string|int, mixed>
-
parameters list
Tags
__callStatic()
Dynamically handle calls to the class.
public
static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
-
magic method name called
- $parameters : array<string|int, mixed>
-
parameters list
Tags
__get()
Get a part of the Carbon object.
public
__get(string $name) : string|int|bool|DateTimeZone|null
Parameters
- $name : string
Tags
Return values
string|int|bool|DateTimeZone|null__isset()
Check if an attribute exists on the object
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
Set a part of the Carbon object
public
__set(string $name, string|int|DateTimeZone $value) : void
Parameters
- $name : string
- $value : string|int|DateTimeZone
Tags
addCenturies()
public
addCenturies(int|float $value = 1) : CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddCenturiesNoOverflow()
public
addCenturiesNoOverflow(int|float $value = 1) : CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddCenturiesWithNoOverflow()
public
addCenturiesWithNoOverflow(int|float $value = 1) : CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddCenturiesWithoutOverflow()
public
addCenturiesWithoutOverflow(int|float $value = 1) : CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddCenturiesWithOverflow()
public
addCenturiesWithOverflow(int|float $value = 1) : CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddCentury()
public
addCentury() : CarbonInterface
Add one century to the instance (using date interval).
Return values
CarbonInterfaceaddCenturyNoOverflow()
public
addCenturyNoOverflow() : CarbonInterface
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddCenturyWithNoOverflow()
public
addCenturyWithNoOverflow() : CarbonInterface
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddCenturyWithoutOverflow()
public
addCenturyWithoutOverflow() : CarbonInterface
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddCenturyWithOverflow()
public
addCenturyWithOverflow() : CarbonInterface
Add one century to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfaceaddDay()
public
addDay() : CarbonInterface
Add one day to the instance (using date interval).
Return values
CarbonInterfaceaddDays()
public
addDays(int|float $value = 1) : CarbonInterface
Add days (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddDecade()
public
addDecade() : CarbonInterface
Add one decade to the instance (using date interval).
Return values
CarbonInterfaceaddDecadeNoOverflow()
public
addDecadeNoOverflow() : CarbonInterface
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddDecades()
public
addDecades(int|float $value = 1) : CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddDecadesNoOverflow()
public
addDecadesNoOverflow(int|float $value = 1) : CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddDecadesWithNoOverflow()
public
addDecadesWithNoOverflow(int|float $value = 1) : CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddDecadesWithoutOverflow()
public
addDecadesWithoutOverflow(int|float $value = 1) : CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddDecadesWithOverflow()
public
addDecadesWithOverflow(int|float $value = 1) : CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddDecadeWithNoOverflow()
public
addDecadeWithNoOverflow() : CarbonInterface
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddDecadeWithoutOverflow()
public
addDecadeWithoutOverflow() : CarbonInterface
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddDecadeWithOverflow()
public
addDecadeWithOverflow() : CarbonInterface
Add one decade to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfaceaddHour()
public
addHour() : CarbonInterface
Add one hour to the instance (using date interval).
Return values
CarbonInterfaceaddHours()
public
addHours(int|float $value = 1) : CarbonInterface
Add hours (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMicro()
public
addMicro() : CarbonInterface
Add one microsecond to the instance (using date interval).
Return values
CarbonInterfaceaddMicros()
public
addMicros(int|float $value = 1) : CarbonInterface
Add microseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMicrosecond()
public
addMicrosecond() : CarbonInterface
Add one microsecond to the instance (using date interval).
Return values
CarbonInterfaceaddMicroseconds()
public
addMicroseconds(int|float $value = 1) : CarbonInterface
Add microseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMillennia()
public
addMillennia(int|float $value = 1) : CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMillenniaNoOverflow()
public
addMillenniaNoOverflow(int|float $value = 1) : CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMillenniaWithNoOverflow()
public
addMillenniaWithNoOverflow(int|float $value = 1) : CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMillenniaWithoutOverflow()
public
addMillenniaWithoutOverflow(int|float $value = 1) : CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMillenniaWithOverflow()
public
addMillenniaWithOverflow(int|float $value = 1) : CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMillennium()
public
addMillennium() : CarbonInterface
Add one millennium to the instance (using date interval).
Return values
CarbonInterfaceaddMillenniumNoOverflow()
public
addMillenniumNoOverflow() : CarbonInterface
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddMillenniumWithNoOverflow()
public
addMillenniumWithNoOverflow() : CarbonInterface
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddMillenniumWithoutOverflow()
public
addMillenniumWithoutOverflow() : CarbonInterface
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddMillenniumWithOverflow()
public
addMillenniumWithOverflow() : CarbonInterface
Add one millennium to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfaceaddMilli()
public
addMilli() : CarbonInterface
Add one millisecond to the instance (using date interval).
Return values
CarbonInterfaceaddMillis()
public
addMillis(int|float $value = 1) : CarbonInterface
Add milliseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMillisecond()
public
addMillisecond() : CarbonInterface
Add one millisecond to the instance (using date interval).
Return values
CarbonInterfaceaddMilliseconds()
public
addMilliseconds(int|float $value = 1) : CarbonInterface
Add milliseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMinute()
public
addMinute() : CarbonInterface
Add one minute to the instance (using date interval).
Return values
CarbonInterfaceaddMinutes()
public
addMinutes(int|float $value = 1) : CarbonInterface
Add minutes (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMonth()
public
addMonth() : CarbonInterface
Add one month to the instance (using date interval).
Return values
CarbonInterfaceaddMonthNoOverflow()
public
addMonthNoOverflow() : CarbonInterface
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddMonths()
public
addMonths(int|float $value = 1) : CarbonInterface
Add months (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMonthsNoOverflow()
public
addMonthsNoOverflow(int|float $value = 1) : CarbonInterface
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMonthsWithNoOverflow()
public
addMonthsWithNoOverflow(int|float $value = 1) : CarbonInterface
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMonthsWithoutOverflow()
public
addMonthsWithoutOverflow(int|float $value = 1) : CarbonInterface
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMonthsWithOverflow()
public
addMonthsWithOverflow(int|float $value = 1) : CarbonInterface
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddMonthWithNoOverflow()
public
addMonthWithNoOverflow() : CarbonInterface
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddMonthWithoutOverflow()
public
addMonthWithoutOverflow() : CarbonInterface
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddMonthWithOverflow()
public
addMonthWithOverflow() : CarbonInterface
Add one month to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfaceaddQuarter()
public
addQuarter() : CarbonInterface
Add one quarter to the instance (using date interval).
Return values
CarbonInterfaceaddQuarterNoOverflow()
public
addQuarterNoOverflow() : CarbonInterface
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddQuarters()
public
addQuarters(int|float $value = 1) : CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddQuartersNoOverflow()
public
addQuartersNoOverflow(int|float $value = 1) : CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddQuartersWithNoOverflow()
public
addQuartersWithNoOverflow(int|float $value = 1) : CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddQuartersWithoutOverflow()
public
addQuartersWithoutOverflow(int|float $value = 1) : CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddQuartersWithOverflow()
public
addQuartersWithOverflow(int|float $value = 1) : CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddQuarterWithNoOverflow()
public
addQuarterWithNoOverflow() : CarbonInterface
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddQuarterWithoutOverflow()
public
addQuarterWithoutOverflow() : CarbonInterface
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddQuarterWithOverflow()
public
addQuarterWithOverflow() : CarbonInterface
Add one quarter to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfaceaddSecond()
public
addSecond() : CarbonInterface
Add one second to the instance (using date interval).
Return values
CarbonInterfaceaddSeconds()
public
addSeconds(int|float $value = 1) : CarbonInterface
Add seconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUnitNoOverflow()
Add any unit to a new value without overflowing current other unit given.
public
addUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit) : static
Parameters
- $valueUnit : string
-
unit name to modify
- $value : int
-
amount to add to the input unit
- $overflowUnit : string
-
unit name to not overflow
Return values
staticaddUTCCenturies()
public
addUTCCenturies(int|float $value = 1) : CarbonInterface
Add centuries (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCCentury()
public
addUTCCentury() : CarbonInterface
Add one century to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCDay()
public
addUTCDay() : CarbonInterface
Add one day to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCDays()
public
addUTCDays(int|float $value = 1) : CarbonInterface
Add days (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCDecade()
public
addUTCDecade() : CarbonInterface
Add one decade to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCDecades()
public
addUTCDecades(int|float $value = 1) : CarbonInterface
Add decades (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCHour()
public
addUTCHour() : CarbonInterface
Add one hour to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCHours()
public
addUTCHours(int|float $value = 1) : CarbonInterface
Add hours (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCMicro()
public
addUTCMicro() : CarbonInterface
Add one microsecond to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCMicros()
public
addUTCMicros(int|float $value = 1) : CarbonInterface
Add microseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCMicrosecond()
public
addUTCMicrosecond() : CarbonInterface
Add one microsecond to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCMicroseconds()
public
addUTCMicroseconds(int|float $value = 1) : CarbonInterface
Add microseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCMillennia()
public
addUTCMillennia(int|float $value = 1) : CarbonInterface
Add millennia (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCMillennium()
public
addUTCMillennium() : CarbonInterface
Add one millennium to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCMilli()
public
addUTCMilli() : CarbonInterface
Add one millisecond to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCMillis()
public
addUTCMillis(int|float $value = 1) : CarbonInterface
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCMillisecond()
public
addUTCMillisecond() : CarbonInterface
Add one millisecond to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCMilliseconds()
public
addUTCMilliseconds(int|float $value = 1) : CarbonInterface
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCMinute()
public
addUTCMinute() : CarbonInterface
Add one minute to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCMinutes()
public
addUTCMinutes(int|float $value = 1) : CarbonInterface
Add minutes (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCMonth()
public
addUTCMonth() : CarbonInterface
Add one month to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCMonths()
public
addUTCMonths(int|float $value = 1) : CarbonInterface
Add months (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCQuarter()
public
addUTCQuarter() : CarbonInterface
Add one quarter to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCQuarters()
public
addUTCQuarters(int|float $value = 1) : CarbonInterface
Add quarters (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCSecond()
public
addUTCSecond() : CarbonInterface
Add one second to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCSeconds()
public
addUTCSeconds(int|float $value = 1) : CarbonInterface
Add seconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCWeek()
public
addUTCWeek() : CarbonInterface
Add one week to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCWeeks()
public
addUTCWeeks(int|float $value = 1) : CarbonInterface
Add weeks (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddUTCYear()
public
addUTCYear() : CarbonInterface
Add one year to the instance (using timestamp).
Return values
CarbonInterfaceaddUTCYears()
public
addUTCYears(int|float $value = 1) : CarbonInterface
Add years (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddWeek()
public
addWeek() : CarbonInterface
Add one week to the instance (using date interval).
Return values
CarbonInterfaceaddWeekday()
public
addWeekday() : CarbonInterface
Add one weekday to the instance (using date interval).
Return values
CarbonInterfaceaddWeekdays()
public
addWeekdays(int|float $value = 1) : CarbonInterface
Add weekdays (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddWeeks()
public
addWeeks(int|float $value = 1) : CarbonInterface
Add weeks (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddYear()
public
addYear() : CarbonInterface
Add one year to the instance (using date interval).
Return values
CarbonInterfaceaddYearNoOverflow()
public
addYearNoOverflow() : CarbonInterface
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddYears()
public
addYears(int|float $value = 1) : CarbonInterface
Add years (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddYearsNoOverflow()
public
addYearsNoOverflow(int|float $value = 1) : CarbonInterface
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddYearsWithNoOverflow()
public
addYearsWithNoOverflow(int|float $value = 1) : CarbonInterface
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddYearsWithoutOverflow()
public
addYearsWithoutOverflow(int|float $value = 1) : CarbonInterface
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddYearsWithOverflow()
public
addYearsWithOverflow(int|float $value = 1) : CarbonInterface
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfaceaddYearWithNoOverflow()
public
addYearWithNoOverflow() : CarbonInterface
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddYearWithoutOverflow()
public
addYearWithoutOverflow() : CarbonInterface
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfaceaddYearWithOverflow()
public
addYearWithOverflow() : CarbonInterface
Add one year to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfaceavoidMutation()
Clone the current instance if it's mutable.
public
avoidMutation() : static
This method is convenient to ensure you don't mutate the initial object but avoid to make a useless copy of it if it's already immutable.
Return values
staticcarbonize()
Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
public
carbonize([Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null $date = null ]) : static
Parameters
- $date : Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null = null
Return values
staticceilCenturies()
public
ceilCenturies(float $precision = 1) : CarbonInterface
Ceil the current instance century with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilCentury()
public
ceilCentury(float $precision = 1) : CarbonInterface
Ceil the current instance century with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilDay()
public
ceilDay(float $precision = 1) : CarbonInterface
Ceil the current instance day with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilDays()
public
ceilDays(float $precision = 1) : CarbonInterface
Ceil the current instance day with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilDecade()
public
ceilDecade(float $precision = 1) : CarbonInterface
Ceil the current instance decade with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilDecades()
public
ceilDecades(float $precision = 1) : CarbonInterface
Ceil the current instance decade with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilHour()
public
ceilHour(float $precision = 1) : CarbonInterface
Ceil the current instance hour with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilHours()
public
ceilHours(float $precision = 1) : CarbonInterface
Ceil the current instance hour with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMicrosecond()
public
ceilMicrosecond(float $precision = 1) : CarbonInterface
Ceil the current instance microsecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMicroseconds()
public
ceilMicroseconds(float $precision = 1) : CarbonInterface
Ceil the current instance microsecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMillennia()
public
ceilMillennia(float $precision = 1) : CarbonInterface
Ceil the current instance millennium with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMillennium()
public
ceilMillennium(float $precision = 1) : CarbonInterface
Ceil the current instance millennium with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMillisecond()
public
ceilMillisecond(float $precision = 1) : CarbonInterface
Ceil the current instance millisecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMilliseconds()
public
ceilMilliseconds(float $precision = 1) : CarbonInterface
Ceil the current instance millisecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMinute()
public
ceilMinute(float $precision = 1) : CarbonInterface
Ceil the current instance minute with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMinutes()
public
ceilMinutes(float $precision = 1) : CarbonInterface
Ceil the current instance minute with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMonth()
public
ceilMonth(float $precision = 1) : CarbonInterface
Ceil the current instance month with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilMonths()
public
ceilMonths(float $precision = 1) : CarbonInterface
Ceil the current instance month with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilQuarter()
public
ceilQuarter(float $precision = 1) : CarbonInterface
Ceil the current instance quarter with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilQuarters()
public
ceilQuarters(float $precision = 1) : CarbonInterface
Ceil the current instance quarter with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilSecond()
public
ceilSecond(float $precision = 1) : CarbonInterface
Ceil the current instance second with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilSeconds()
public
ceilSeconds(float $precision = 1) : CarbonInterface
Ceil the current instance second with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilYear()
public
ceilYear(float $precision = 1) : CarbonInterface
Ceil the current instance year with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceceilYears()
public
ceilYears(float $precision = 1) : CarbonInterface
Ceil the current instance year with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacecenturiesInMillennium()
public
centuriesInMillennium() : int
Return the number of centuries contained in the current millennium
Return values
intcenturiesUntil()
public
centuriesUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodcenturyOfMillennium()
public
centuryOfMillennium(int|null $century = null) : int|static
Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value
Parameters
- $century = null : int|null
Return values
int|staticclone()
public
clone() : static
Tags
Return values
staticcopy()
Get a copy of the instance.
public
copy() : static
Return values
staticday()
public
day(int $value) : CarbonInterface
Set current instance day to the given value.
Parameters
- $value : int
Return values
CarbonInterfacedayOfCentury()
public
dayOfCentury(int|null $day = null) : int|static
Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value
Parameters
- $day = null : int|null
Return values
int|staticdayOfDecade()
public
dayOfDecade(int|null $day = null) : int|static
Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value
Parameters
- $day = null : int|null
Return values
int|staticdayOfMillennium()
public
dayOfMillennium(int|null $day = null) : int|static
Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value
Parameters
- $day = null : int|null
Return values
int|staticdayOfMonth()
public
dayOfMonth(int|null $day = null) : int|static
Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value
Parameters
- $day = null : int|null
Return values
int|staticdayOfQuarter()
public
dayOfQuarter(int|null $day = null) : int|static
Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value
Parameters
- $day = null : int|null
Return values
int|staticdayOfWeek()
public
dayOfWeek(int|null $day = null) : int|static
Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value
Parameters
- $day = null : int|null
Return values
int|staticdayOfYear()
Get/set the day of year.
public
dayOfYear([int|null $value = null ]) : static|int
Parameters
- $value : int|null = null
-
new value for day of year if using as setter.
Tags
Return values
static|intdays()
public
days(int $value) : CarbonInterface
Set current instance day to the given value.
Parameters
- $value : int
Return values
CarbonInterfacedaysInCentury()
public
daysInCentury() : int
Return the number of days contained in the current century
Return values
intdaysInDecade()
public
daysInDecade() : int
Return the number of days contained in the current decade
Return values
intdaysInMillennium()
public
daysInMillennium() : int
Return the number of days contained in the current millennium
Return values
intdaysInMonth()
public
daysInMonth() : int
Return the number of days contained in the current month
Return values
intdaysInQuarter()
public
daysInQuarter() : int
Return the number of days contained in the current quarter
Return values
intdaysInWeek()
public
daysInWeek() : int
Return the number of days contained in the current week
Return values
intdaysInYear()
public
daysInYear() : int
Return the number of days contained in the current year
Return values
intdaysUntil()
public
daysUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPerioddecadeOfCentury()
public
decadeOfCentury(int|null $decade = null) : int|static
Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value
Parameters
- $decade = null : int|null
Return values
int|staticdecadeOfMillennium()
public
decadeOfMillennium(int|null $decade = null) : int|static
Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value
Parameters
- $decade = null : int|null
Return values
int|staticdecadesInCentury()
public
decadesInCentury() : int
Return the number of decades contained in the current century
Return values
intdecadesInMillennium()
public
decadesInMillennium() : int
Return the number of decades contained in the current millennium
Return values
intdecadesUntil()
public
decadesUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPerioddiffInUTCCenturies()
public
diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of centuries.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCDays()
public
diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of days.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCDecades()
public
diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of decades.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCHours()
public
diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of hours.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCMicros()
public
diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of microseconds.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCMicroseconds()
public
diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of microseconds.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCMillennia()
public
diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of millennia.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCMillis()
public
diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of milliseconds.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCMilliseconds()
public
diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of milliseconds.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCMinutes()
public
diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of minutes.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCMonths()
public
diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of months.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCQuarters()
public
diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of quarters.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCSeconds()
public
diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of seconds.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCWeeks()
public
diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of weeks.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatdiffInUTCYears()
public
diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) : float
Convert current and given date in UTC timezone and return a floating number of years.
Parameters
- $date : DateTimeInterface|string|null
- $absolute = false : bool
Return values
floatfloorCenturies()
public
floorCenturies(float $precision = 1) : CarbonInterface
Truncate the current instance century with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorCentury()
public
floorCentury(float $precision = 1) : CarbonInterface
Truncate the current instance century with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorDay()
public
floorDay(float $precision = 1) : CarbonInterface
Truncate the current instance day with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorDays()
public
floorDays(float $precision = 1) : CarbonInterface
Truncate the current instance day with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorDecade()
public
floorDecade(float $precision = 1) : CarbonInterface
Truncate the current instance decade with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorDecades()
public
floorDecades(float $precision = 1) : CarbonInterface
Truncate the current instance decade with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorHour()
public
floorHour(float $precision = 1) : CarbonInterface
Truncate the current instance hour with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorHours()
public
floorHours(float $precision = 1) : CarbonInterface
Truncate the current instance hour with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMicrosecond()
public
floorMicrosecond(float $precision = 1) : CarbonInterface
Truncate the current instance microsecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMicroseconds()
public
floorMicroseconds(float $precision = 1) : CarbonInterface
Truncate the current instance microsecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMillennia()
public
floorMillennia(float $precision = 1) : CarbonInterface
Truncate the current instance millennium with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMillennium()
public
floorMillennium(float $precision = 1) : CarbonInterface
Truncate the current instance millennium with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMillisecond()
public
floorMillisecond(float $precision = 1) : CarbonInterface
Truncate the current instance millisecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMilliseconds()
public
floorMilliseconds(float $precision = 1) : CarbonInterface
Truncate the current instance millisecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMinute()
public
floorMinute(float $precision = 1) : CarbonInterface
Truncate the current instance minute with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMinutes()
public
floorMinutes(float $precision = 1) : CarbonInterface
Truncate the current instance minute with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMonth()
public
floorMonth(float $precision = 1) : CarbonInterface
Truncate the current instance month with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorMonths()
public
floorMonths(float $precision = 1) : CarbonInterface
Truncate the current instance month with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorQuarter()
public
floorQuarter(float $precision = 1) : CarbonInterface
Truncate the current instance quarter with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorQuarters()
public
floorQuarters(float $precision = 1) : CarbonInterface
Truncate the current instance quarter with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorSecond()
public
floorSecond(float $precision = 1) : CarbonInterface
Truncate the current instance second with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorSeconds()
public
floorSeconds(float $precision = 1) : CarbonInterface
Truncate the current instance second with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorYear()
public
floorYear(float $precision = 1) : CarbonInterface
Truncate the current instance year with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfacefloorYears()
public
floorYears(float $precision = 1) : CarbonInterface
Truncate the current instance year with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonInterfaceget()
Get a part of the Carbon object.
public
get(Unit|string $name) : string|int|bool|DateTimeZone
Parameters
- $name : Unit|string
Tags
Return values
string|int|bool|DateTimeZonegetAltNumber()
Returns the alternative number for a given date property if available in the current locale.
public
getAltNumber(string $key) : string
Parameters
- $key : string
-
date property
Return values
stringgetCalendarFormats()
Returns list of calendar formats for ISO formatting.
public
getCalendarFormats([string|null $locale = null ]) : array<string|int, mixed>
Parameters
- $locale : string|null = null
-
current locale used if null
Return values
array<string|int, mixed>getDays()
Get the days of the week.
public
static getDays() : array<string|int, mixed>
Return values
array<string|int, mixed>getDaysFromStartOfWeek()
Return the number of days since the start of the week (using the current locale or the first parameter if explicitly given).
public
getDaysFromStartOfWeek([WeekDay|int|null $weekStartsAt = null ]) : int
Parameters
- $weekStartsAt : WeekDay|int|null = null
-
optional start allow you to specify the day of week to use to start the week, if not provided, start of week is inferred from the locale (Sunday for en_US, Monday for de_DE, etc.)
Return values
intgetFormatsToIsoReplacements()
List of replacements from date() format to isoFormat().
public
static getFormatsToIsoReplacements() : array<string|int, mixed>
Return values
array<string|int, mixed>getIsoFormats()
Returns list of locale formats for ISO formatting.
public
getIsoFormats([string|null $locale = null ]) : array<string|int, mixed>
Parameters
- $locale : string|null = null
-
current locale used if null
Return values
array<string|int, mixed>getIsoUnits()
Returns list of locale units for ISO formatting.
public
static getIsoUnits() : array<string|int, mixed>
Return values
array<string|int, mixed>getOffsetString()
Returns the offset hour and minute formatted with +/- and a given separator (":" by default).
public
getOffsetString([string $separator = ':' ]) : string
For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something like "-12:00".
Parameters
- $separator : string = ':'
-
string to place between hours and minutes (":" by default)
Return values
stringgetPaddedUnit()
Returns a unit of the instance padded with 0 by default or any other string if specified.
public
getPaddedUnit(string $unit[, int $length = 2 ][, string $padString = '0' ][, int $padType = STR_PAD_LEFT ]) : string
Parameters
- $unit : string
-
Carbon unit name
- $length : int = 2
-
Length of the output (2 by default)
- $padString : string = '0'
-
String to use for padding ("0" by default)
- $padType : int = STR_PAD_LEFT
-
Side(s) to pad (STR_PAD_LEFT by default)
Return values
stringgetTimezone()
Get the TimeZone associated with the Carbon instance (as CarbonTimeZone).
public
getTimezone() : CarbonTimeZone
Tags
Return values
CarbonTimeZonegetTranslatedDayName()
Get the translation of the current week day name (with context for languages with multiple forms).
public
getTranslatedDayName([string|null $context = null ][, string $keySuffix = '' ][, string|null $defaultValue = null ]) : string
Parameters
- $context : string|null = null
-
whole format string
- $keySuffix : string = ''
-
"", "_short" or "_min"
- $defaultValue : string|null = null
-
default value if translation missing
Return values
stringgetTranslatedMinDayName()
Get the translation of the current abbreviated week day name (with context for languages with multiple forms).
public
getTranslatedMinDayName([string|null $context = null ]) : string
Parameters
- $context : string|null = null
-
whole format string
Return values
stringgetTranslatedMonthName()
Get the translation of the current month day name (with context for languages with multiple forms).
public
getTranslatedMonthName([string|null $context = null ][, string $keySuffix = '' ][, string|null $defaultValue = null ]) : string
Parameters
- $context : string|null = null
-
whole format string
- $keySuffix : string = ''
-
"" or "_short"
- $defaultValue : string|null = null
-
default value if translation missing
Return values
stringgetTranslatedShortDayName()
Get the translation of the current short week day name (with context for languages with multiple forms).
public
getTranslatedShortDayName([string|null $context = null ]) : string
Parameters
- $context : string|null = null
-
whole format string
Return values
stringgetTranslatedShortMonthName()
Get the translation of the current short month day name (with context for languages with multiple forms).
public
getTranslatedShortMonthName([string|null $context = null ]) : string
Parameters
- $context : string|null = null
-
whole format string
Return values
stringgetWeekendDays()
Get weekend days
public
static getWeekendDays() : array<string|int, mixed>
Return values
array<string|int, mixed>getWeekEndsAt()
Get the last day of week.
public
static getWeekEndsAt([string $locale = null ]) : int
Parameters
- $locale : string = null
-
local to consider the last day of week.
Return values
intgetWeekStartsAt()
Get the first day of week.
public
static getWeekStartsAt([string|null $locale = null ]) : int
Parameters
- $locale : string|null = null
Return values
inthasRelativeKeywords()
Determine if a time string will produce a relative date.
public
static hasRelativeKeywords(string|null $time) : bool
Parameters
- $time : string|null
Return values
bool —true if time match a relative date, false if absolute or invalid time string
hour()
public
hour(int $value) : CarbonInterface
Set current instance hour to the given value.
Parameters
- $value : int
Return values
CarbonInterfacehourOfCentury()
public
hourOfCentury(int|null $hour = null) : int|static
Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value
Parameters
- $hour = null : int|null
Return values
int|statichourOfDay()
public
hourOfDay(int|null $hour = null) : int|static
Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value
Parameters
- $hour = null : int|null
Return values
int|statichourOfDecade()
public
hourOfDecade(int|null $hour = null) : int|static
Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value
Parameters
- $hour = null : int|null
Return values
int|statichourOfMillennium()
public
hourOfMillennium(int|null $hour = null) : int|static
Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value
Parameters
- $hour = null : int|null
Return values
int|statichourOfMonth()
public
hourOfMonth(int|null $hour = null) : int|static
Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value
Parameters
- $hour = null : int|null
Return values
int|statichourOfQuarter()
public
hourOfQuarter(int|null $hour = null) : int|static
Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value
Parameters
- $hour = null : int|null
Return values
int|statichourOfWeek()
public
hourOfWeek(int|null $hour = null) : int|static
Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value
Parameters
- $hour = null : int|null
Return values
int|statichourOfYear()
public
hourOfYear(int|null $hour = null) : int|static
Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value
Parameters
- $hour = null : int|null
Return values
int|statichours()
public
hours(int $value) : CarbonInterface
Set current instance hour to the given value.
Parameters
- $value : int
Return values
CarbonInterfacehoursInCentury()
public
hoursInCentury() : int
Return the number of hours contained in the current century
Return values
inthoursInDay()
public
hoursInDay() : int
Return the number of hours contained in the current day
Return values
inthoursInDecade()
public
hoursInDecade() : int
Return the number of hours contained in the current decade
Return values
inthoursInMillennium()
public
hoursInMillennium() : int
Return the number of hours contained in the current millennium
Return values
inthoursInMonth()
public
hoursInMonth() : int
Return the number of hours contained in the current month
Return values
inthoursInQuarter()
public
hoursInQuarter() : int
Return the number of hours contained in the current quarter
Return values
inthoursInWeek()
public
hoursInWeek() : int
Return the number of hours contained in the current week
Return values
inthoursInYear()
public
hoursInYear() : int
Return the number of hours contained in the current year
Return values
inthoursUntil()
public
hoursUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodisCurrentCentury()
public
isCurrentCentury() : bool
Checks if the instance is in the same century as the current moment.
Return values
boolisCurrentDay()
public
isCurrentDay() : bool
Checks if the instance is in the same day as the current moment.
Return values
boolisCurrentDecade()
public
isCurrentDecade() : bool
Checks if the instance is in the same decade as the current moment.
Return values
boolisCurrentHour()
public
isCurrentHour() : bool
Checks if the instance is in the same hour as the current moment.
Return values
boolisCurrentMicro()
public
isCurrentMicro() : bool
Checks if the instance is in the same microsecond as the current moment.
Return values
boolisCurrentMicrosecond()
public
isCurrentMicrosecond() : bool
Checks if the instance is in the same microsecond as the current moment.
Return values
boolisCurrentMillennium()
public
isCurrentMillennium() : bool
Checks if the instance is in the same millennium as the current moment.
Return values
boolisCurrentMilli()
public
isCurrentMilli() : bool
Checks if the instance is in the same millisecond as the current moment.
Return values
boolisCurrentMillisecond()
public
isCurrentMillisecond() : bool
Checks if the instance is in the same millisecond as the current moment.
Return values
boolisCurrentMinute()
public
isCurrentMinute() : bool
Checks if the instance is in the same minute as the current moment.
Return values
boolisCurrentMonth()
public
isCurrentMonth() : bool
Checks if the instance is in the same month as the current moment.
Return values
boolisCurrentQuarter()
public
isCurrentQuarter() : bool
Checks if the instance is in the same quarter as the current moment.
Return values
boolisCurrentSecond()
public
isCurrentSecond() : bool
Checks if the instance is in the same second as the current moment.
Return values
boolisCurrentWeek()
public
isCurrentWeek() : bool
Checks if the instance is in the same week as the current moment.
Return values
boolisCurrentYear()
public
isCurrentYear() : bool
Checks if the instance is in the same year as the current moment.
Return values
boolisDST()
public
isDST() : bool
Check if the current instance is in a daylight saving time.
Return values
boolisFriday()
public
isFriday() : bool
Checks if the instance day is friday.
Return values
boolisLastCentury()
public
isLastCentury() : bool
Checks if the instance is in the same century as the current moment last century.
Return values
boolisLastDay()
public
isLastDay() : bool
Checks if the instance is in the same day as the current moment last day.
Return values
boolisLastDecade()
public
isLastDecade() : bool
Checks if the instance is in the same decade as the current moment last decade.
Return values
boolisLastHour()
public
isLastHour() : bool
Checks if the instance is in the same hour as the current moment last hour.
Return values
boolisLastMicro()
public
isLastMicro() : bool
Checks if the instance is in the same microsecond as the current moment last microsecond.
Return values
boolisLastMicrosecond()
public
isLastMicrosecond() : bool
Checks if the instance is in the same microsecond as the current moment last microsecond.
Return values
boolisLastMillennium()
public
isLastMillennium() : bool
Checks if the instance is in the same millennium as the current moment last millennium.
Return values
boolisLastMilli()
public
isLastMilli() : bool
Checks if the instance is in the same millisecond as the current moment last millisecond.
Return values
boolisLastMillisecond()
public
isLastMillisecond() : bool
Checks if the instance is in the same millisecond as the current moment last millisecond.
Return values
boolisLastMinute()
public
isLastMinute() : bool
Checks if the instance is in the same minute as the current moment last minute.
Return values
boolisLastMonth()
public
isLastMonth() : bool
Checks if the instance is in the same month as the current moment last month.
Return values
boolisLastQuarter()
public
isLastQuarter() : bool
Checks if the instance is in the same quarter as the current moment last quarter.
Return values
boolisLastSecond()
public
isLastSecond() : bool
Checks if the instance is in the same second as the current moment last second.
Return values
boolisLastWeek()
public
isLastWeek() : bool
Checks if the instance is in the same week as the current moment last week.
Return values
boolisLastYear()
public
isLastYear() : bool
Checks if the instance is in the same year as the current moment last year.
Return values
boolisLocal()
public
isLocal() : bool
Check if the current instance has non-UTC timezone.
Return values
boolisMonday()
public
isMonday() : bool
Checks if the instance day is monday.
Return values
boolisNextCentury()
public
isNextCentury() : bool
Checks if the instance is in the same century as the current moment next century.
Return values
boolisNextDay()
public
isNextDay() : bool
Checks if the instance is in the same day as the current moment next day.
Return values
boolisNextDecade()
public
isNextDecade() : bool
Checks if the instance is in the same decade as the current moment next decade.
Return values
boolisNextHour()
public
isNextHour() : bool
Checks if the instance is in the same hour as the current moment next hour.
Return values
boolisNextMicro()
public
isNextMicro() : bool
Checks if the instance is in the same microsecond as the current moment next microsecond.
Return values
boolisNextMicrosecond()
public
isNextMicrosecond() : bool
Checks if the instance is in the same microsecond as the current moment next microsecond.
Return values
boolisNextMillennium()
public
isNextMillennium() : bool
Checks if the instance is in the same millennium as the current moment next millennium.
Return values
boolisNextMilli()
public
isNextMilli() : bool
Checks if the instance is in the same millisecond as the current moment next millisecond.
Return values
boolisNextMillisecond()
public
isNextMillisecond() : bool
Checks if the instance is in the same millisecond as the current moment next millisecond.
Return values
boolisNextMinute()
public
isNextMinute() : bool
Checks if the instance is in the same minute as the current moment next minute.
Return values
boolisNextMonth()
public
isNextMonth() : bool
Checks if the instance is in the same month as the current moment next month.
Return values
boolisNextQuarter()
public
isNextQuarter() : bool
Checks if the instance is in the same quarter as the current moment next quarter.
Return values
boolisNextSecond()
public
isNextSecond() : bool
Checks if the instance is in the same second as the current moment next second.
Return values
boolisNextWeek()
public
isNextWeek() : bool
Checks if the instance is in the same week as the current moment next week.
Return values
boolisNextYear()
public
isNextYear() : bool
Checks if the instance is in the same year as the current moment next year.
Return values
boolisoFormat()
Format in the current language using ISO replacement patterns.
public
isoFormat(string $format[, string|null $originalFormat = null ]) : string
Parameters
- $format : string
- $originalFormat : string|null = null
-
provide context if a chunk has been passed alone
Return values
stringisoWeekday()
Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
public
isoWeekday([WeekDay|int|null $value = null ]) : static|int
Parameters
- $value : WeekDay|int|null = null
-
new value for weekday if using as setter.
Return values
static|intisSameCentury()
public
isSameCentury(DateTimeInterface|string $date) : bool
Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameDay()
public
isSameDay(DateTimeInterface|string $date) : bool
Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameDecade()
public
isSameDecade(DateTimeInterface|string $date) : bool
Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameHour()
public
isSameHour(DateTimeInterface|string $date) : bool
Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameMicro()
public
isSameMicro(DateTimeInterface|string $date) : bool
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameMicrosecond()
public
isSameMicrosecond(DateTimeInterface|string $date) : bool
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameMillennium()
public
isSameMillennium(DateTimeInterface|string $date) : bool
Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameMilli()
public
isSameMilli(DateTimeInterface|string $date) : bool
Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameMillisecond()
public
isSameMillisecond(DateTimeInterface|string $date) : bool
Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameMinute()
public
isSameMinute(DateTimeInterface|string $date) : bool
Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameSecond()
public
isSameSecond(DateTimeInterface|string $date) : bool
Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameWeek()
public
isSameWeek(DateTimeInterface|string $date) : bool
Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSameYear()
public
isSameYear(DateTimeInterface|string $date) : bool
Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
Parameters
- $date : DateTimeInterface|string
Return values
boolisSaturday()
public
isSaturday() : bool
Checks if the instance day is saturday.
Return values
boolisSunday()
public
isSunday() : bool
Checks if the instance day is sunday.
Return values
boolisThursday()
public
isThursday() : bool
Checks if the instance day is thursday.
Return values
boolisTuesday()
public
isTuesday() : bool
Checks if the instance day is tuesday.
Return values
boolisUtc()
public
isUtc() : bool
Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
Return values
boolisValid()
public
isValid() : bool
Check if the current instance is a valid date.
Return values
boolisWednesday()
public
isWednesday() : bool
Checks if the instance day is wednesday.
Return values
boollongAbsoluteDiffForHumans()
public
longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) : string
Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Parameters
- $other = null : DateTimeInterface
- $parts = 1 : int
Return values
stringlongRelativeDiffForHumans()
public
longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) : string
Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Parameters
- $other = null : DateTimeInterface
- $parts = 1 : int
Return values
stringlongRelativeToNowDiffForHumans()
public
longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) : string
Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Parameters
- $other = null : DateTimeInterface
- $parts = 1 : int
Return values
stringlongRelativeToOtherDiffForHumans()
public
longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) : string
Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Parameters
- $other = null : DateTimeInterface
- $parts = 1 : int
Return values
stringmeridiem()
Return the meridiem of the current time in the current locale.
public
meridiem([bool $isLower = false ]) : string
Parameters
- $isLower : bool = false
-
if true, returns lowercase variant if available in the current locale.
Return values
stringmicro()
public
micro(int $value) : CarbonInterface
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacemicros()
public
micros(int $value) : CarbonInterface
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacemicrosecond()
public
microsecond(int $value) : CarbonInterface
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacemicrosecondOfCentury()
public
microsecondOfCentury(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfDay()
public
microsecondOfDay(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfDecade()
public
microsecondOfDecade(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfHour()
public
microsecondOfHour(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfMillennium()
public
microsecondOfMillennium(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfMillisecond()
public
microsecondOfMillisecond(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfMinute()
public
microsecondOfMinute(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfMonth()
public
microsecondOfMonth(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfQuarter()
public
microsecondOfQuarter(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfSecond()
public
microsecondOfSecond(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfWeek()
public
microsecondOfWeek(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicrosecondOfYear()
public
microsecondOfYear(int|null $microsecond = null) : int|static
Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value
Parameters
- $microsecond = null : int|null
Return values
int|staticmicroseconds()
public
microseconds(int $value) : CarbonInterface
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacemicrosecondsInCentury()
public
microsecondsInCentury() : int
Return the number of microseconds contained in the current century
Return values
intmicrosecondsInDay()
public
microsecondsInDay() : int
Return the number of microseconds contained in the current day
Return values
intmicrosecondsInDecade()
public
microsecondsInDecade() : int
Return the number of microseconds contained in the current decade
Return values
intmicrosecondsInHour()
public
microsecondsInHour() : int
Return the number of microseconds contained in the current hour
Return values
intmicrosecondsInMillennium()
public
microsecondsInMillennium() : int
Return the number of microseconds contained in the current millennium
Return values
intmicrosecondsInMillisecond()
public
microsecondsInMillisecond() : int
Return the number of microseconds contained in the current millisecond
Return values
intmicrosecondsInMinute()
public
microsecondsInMinute() : int
Return the number of microseconds contained in the current minute
Return values
intmicrosecondsInMonth()
public
microsecondsInMonth() : int
Return the number of microseconds contained in the current month
Return values
intmicrosecondsInQuarter()
public
microsecondsInQuarter() : int
Return the number of microseconds contained in the current quarter
Return values
intmicrosecondsInSecond()
public
microsecondsInSecond() : int
Return the number of microseconds contained in the current second
Return values
intmicrosecondsInWeek()
public
microsecondsInWeek() : int
Return the number of microseconds contained in the current week
Return values
intmicrosecondsInYear()
public
microsecondsInYear() : int
Return the number of microseconds contained in the current year
Return values
intmicrosecondsUntil()
public
microsecondsUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodmicrosUntil()
public
microsUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodmillenniaUntil()
public
millenniaUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodmilli()
public
milli(int $value) : CarbonInterface
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacemillis()
public
millis(int $value) : CarbonInterface
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacemillisecond()
public
millisecond(int $value) : CarbonInterface
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacemillisecondOfCentury()
public
millisecondOfCentury(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfDay()
public
millisecondOfDay(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfDecade()
public
millisecondOfDecade(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfHour()
public
millisecondOfHour(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfMillennium()
public
millisecondOfMillennium(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfMinute()
public
millisecondOfMinute(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfMonth()
public
millisecondOfMonth(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfQuarter()
public
millisecondOfQuarter(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfSecond()
public
millisecondOfSecond(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfWeek()
public
millisecondOfWeek(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmillisecondOfYear()
public
millisecondOfYear(int|null $millisecond = null) : int|static
Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value
Parameters
- $millisecond = null : int|null
Return values
int|staticmilliseconds()
public
milliseconds(int $value) : CarbonInterface
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacemillisecondsInCentury()
public
millisecondsInCentury() : int
Return the number of milliseconds contained in the current century
Return values
intmillisecondsInDay()
public
millisecondsInDay() : int
Return the number of milliseconds contained in the current day
Return values
intmillisecondsInDecade()
public
millisecondsInDecade() : int
Return the number of milliseconds contained in the current decade
Return values
intmillisecondsInHour()
public
millisecondsInHour() : int
Return the number of milliseconds contained in the current hour
Return values
intmillisecondsInMillennium()
public
millisecondsInMillennium() : int
Return the number of milliseconds contained in the current millennium
Return values
intmillisecondsInMinute()
public
millisecondsInMinute() : int
Return the number of milliseconds contained in the current minute
Return values
intmillisecondsInMonth()
public
millisecondsInMonth() : int
Return the number of milliseconds contained in the current month
Return values
intmillisecondsInQuarter()
public
millisecondsInQuarter() : int
Return the number of milliseconds contained in the current quarter
Return values
intmillisecondsInSecond()
public
millisecondsInSecond() : int
Return the number of milliseconds contained in the current second
Return values
intmillisecondsInWeek()
public
millisecondsInWeek() : int
Return the number of milliseconds contained in the current week
Return values
intmillisecondsInYear()
public
millisecondsInYear() : int
Return the number of milliseconds contained in the current year
Return values
intmillisecondsUntil()
public
millisecondsUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodmillisUntil()
public
millisUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodminute()
public
minute(int $value) : CarbonInterface
Set current instance minute to the given value.
Parameters
- $value : int
Return values
CarbonInterfaceminuteOfCentury()
public
minuteOfCentury(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminuteOfDay()
public
minuteOfDay(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminuteOfDecade()
public
minuteOfDecade(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminuteOfHour()
public
minuteOfHour(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminuteOfMillennium()
public
minuteOfMillennium(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminuteOfMonth()
public
minuteOfMonth(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminuteOfQuarter()
public
minuteOfQuarter(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminuteOfWeek()
public
minuteOfWeek(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminuteOfYear()
public
minuteOfYear(int|null $minute = null) : int|static
Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value
Parameters
- $minute = null : int|null
Return values
int|staticminutes()
public
minutes(int $value) : CarbonInterface
Set current instance minute to the given value.
Parameters
- $value : int
Return values
CarbonInterfaceminutesInCentury()
public
minutesInCentury() : int
Return the number of minutes contained in the current century
Return values
intminutesInDay()
public
minutesInDay() : int
Return the number of minutes contained in the current day
Return values
intminutesInDecade()
public
minutesInDecade() : int
Return the number of minutes contained in the current decade
Return values
intminutesInHour()
public
minutesInHour() : int
Return the number of minutes contained in the current hour
Return values
intminutesInMillennium()
public
minutesInMillennium() : int
Return the number of minutes contained in the current millennium
Return values
intminutesInMonth()
public
minutesInMonth() : int
Return the number of minutes contained in the current month
Return values
intminutesInQuarter()
public
minutesInQuarter() : int
Return the number of minutes contained in the current quarter
Return values
intminutesInWeek()
public
minutesInWeek() : int
Return the number of minutes contained in the current week
Return values
intminutesInYear()
public
minutesInYear() : int
Return the number of minutes contained in the current year
Return values
intminutesUntil()
public
minutesUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodmonth()
public
month(Month|int $value) : CarbonInterface
Set current instance month to the given value.
Parameters
- $value : Month|int
Return values
CarbonInterfacemonthOfCentury()
public
monthOfCentury(int|null $month = null) : int|static
Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value
Parameters
- $month = null : int|null
Return values
int|staticmonthOfDecade()
public
monthOfDecade(int|null $month = null) : int|static
Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value
Parameters
- $month = null : int|null
Return values
int|staticmonthOfMillennium()
public
monthOfMillennium(int|null $month = null) : int|static
Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value
Parameters
- $month = null : int|null
Return values
int|staticmonthOfQuarter()
public
monthOfQuarter(int|null $month = null) : int|static
Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value
Parameters
- $month = null : int|null
Return values
int|staticmonthOfYear()
public
monthOfYear(int|null $month = null) : int|static
Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value
Parameters
- $month = null : int|null
Return values
int|staticmonths()
public
months(Month|int $value) : CarbonInterface
Set current instance month to the given value.
Parameters
- $value : Month|int
Return values
CarbonInterfacemonthsInCentury()
public
monthsInCentury() : int
Return the number of months contained in the current century
Return values
intmonthsInDecade()
public
monthsInDecade() : int
Return the number of months contained in the current decade
Return values
intmonthsInMillennium()
public
monthsInMillennium() : int
Return the number of months contained in the current millennium
Return values
intmonthsInQuarter()
public
monthsInQuarter() : int
Return the number of months contained in the current quarter
Return values
intmonthsInYear()
public
monthsInYear() : int
Return the number of months contained in the current year
Return values
intmonthsUntil()
public
monthsUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodnowWithSameTz()
Returns a present instance in the same timezone.
public
nowWithSameTz() : static
Return values
staticordinal()
Return a property with its ordinal.
public
ordinal(string $key[, string|null $period = null ]) : string
Parameters
- $key : string
- $period : string|null = null
Return values
stringpluralUnit()
Returns standardized plural of a given singular/plural unit name (in English).
public
static pluralUnit(string $unit) : string
Parameters
- $unit : string
Return values
stringquarterOfCentury()
public
quarterOfCentury(int|null $quarter = null) : int|static
Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value
Parameters
- $quarter = null : int|null
Return values
int|staticquarterOfDecade()
public
quarterOfDecade(int|null $quarter = null) : int|static
Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value
Parameters
- $quarter = null : int|null
Return values
int|staticquarterOfMillennium()
public
quarterOfMillennium(int|null $quarter = null) : int|static
Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value
Parameters
- $quarter = null : int|null
Return values
int|staticquarterOfYear()
public
quarterOfYear(int|null $quarter = null) : int|static
Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value
Parameters
- $quarter = null : int|null
Return values
int|staticquartersInCentury()
public
quartersInCentury() : int
Return the number of quarters contained in the current century
Return values
intquartersInDecade()
public
quartersInDecade() : int
Return the number of quarters contained in the current decade
Return values
intquartersInMillennium()
public
quartersInMillennium() : int
Return the number of quarters contained in the current millennium
Return values
intquartersInYear()
public
quartersInYear() : int
Return the number of quarters contained in the current year
Return values
intquartersUntil()
public
quartersUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodroundCenturies()
public
roundCenturies(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance century with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundCentury()
public
roundCentury(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance century with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundDay()
public
roundDay(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance day with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundDays()
public
roundDays(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance day with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundDecade()
public
roundDecade(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance decade with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundDecades()
public
roundDecades(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance decade with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundHour()
public
roundHour(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance hour with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundHours()
public
roundHours(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance hour with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMicrosecond()
public
roundMicrosecond(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance microsecond with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMicroseconds()
public
roundMicroseconds(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance microsecond with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMillennia()
public
roundMillennia(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance millennium with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMillennium()
public
roundMillennium(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance millennium with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMillisecond()
public
roundMillisecond(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance millisecond with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMilliseconds()
public
roundMilliseconds(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance millisecond with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMinute()
public
roundMinute(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance minute with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMinutes()
public
roundMinutes(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance minute with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMonth()
public
roundMonth(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance month with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundMonths()
public
roundMonths(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance month with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundQuarter()
public
roundQuarter(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance quarter with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundQuarters()
public
roundQuarters(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance quarter with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundSecond()
public
roundSecond(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance second with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundSeconds()
public
roundSeconds(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance second with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundYear()
public
roundYear(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance year with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfaceroundYears()
public
roundYears(float $precision = 1, string $function = "round") : CarbonInterface
Round the current instance year with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonInterfacesecond()
public
second(int $value) : CarbonInterface
Set current instance second to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesecondOfCentury()
public
secondOfCentury(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfDay()
public
secondOfDay(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfDecade()
public
secondOfDecade(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfHour()
public
secondOfHour(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfMillennium()
public
secondOfMillennium(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfMinute()
public
secondOfMinute(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfMonth()
public
secondOfMonth(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfQuarter()
public
secondOfQuarter(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfWeek()
public
secondOfWeek(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticsecondOfYear()
public
secondOfYear(int|null $second = null) : int|static
Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value
Parameters
- $second = null : int|null
Return values
int|staticseconds()
public
seconds(int $value) : CarbonInterface
Set current instance second to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesecondsInCentury()
public
secondsInCentury() : int
Return the number of seconds contained in the current century
Return values
intsecondsInDay()
public
secondsInDay() : int
Return the number of seconds contained in the current day
Return values
intsecondsInDecade()
public
secondsInDecade() : int
Return the number of seconds contained in the current decade
Return values
intsecondsInHour()
public
secondsInHour() : int
Return the number of seconds contained in the current hour
Return values
intsecondsInMillennium()
public
secondsInMillennium() : int
Return the number of seconds contained in the current millennium
Return values
intsecondsInMinute()
public
secondsInMinute() : int
Return the number of seconds contained in the current minute
Return values
intsecondsInMonth()
public
secondsInMonth() : int
Return the number of seconds contained in the current month
Return values
intsecondsInQuarter()
public
secondsInQuarter() : int
Return the number of seconds contained in the current quarter
Return values
intsecondsInWeek()
public
secondsInWeek() : int
Return the number of seconds contained in the current week
Return values
intsecondsInYear()
public
secondsInYear() : int
Return the number of seconds contained in the current year
Return values
intsecondsUntil()
public
secondsUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodset()
Set a part of the Carbon object.
public
set(Unit|array<string|int, mixed>|string $name[, DateTimeZone|Month|string|int|float|null $value = null ]) : $this
Parameters
- $name : Unit|array<string|int, mixed>|string
- $value : DateTimeZone|Month|string|int|float|null = null
Tags
Return values
$thissetDate()
Set the date with gregorian year, month and day numbers.
public
setDate(int $year, int $month, int $day) : static
Parameters
- $year : int
- $month : int
- $day : int
Tags
Return values
staticsetDateFrom()
Set the year, month, and date for this instance to that of the passed instance.
public
setDateFrom(DateTimeInterface|string $date) : static
Parameters
- $date : DateTimeInterface|string
Return values
staticsetDateTime()
Set the date and time all together.
public
setDateTime(int $year, int $month, int $day, int $hour, int $minute[, int $second = 0 ][, int $microseconds = 0 ]) : static
Parameters
- $year : int
- $month : int
- $day : int
- $hour : int
- $minute : int
- $second : int = 0
- $microseconds : int = 0
Return values
staticsetDateTimeFrom()
Set the date and time for this instance to that of the passed instance.
public
setDateTimeFrom(DateTimeInterface|string $date) : static
Parameters
- $date : DateTimeInterface|string
Return values
staticsetDay()
public
setDay(int $value) : CarbonInterface
Set current instance day to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetDays()
public
setDays(int $value) : CarbonInterface
Set current instance day to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetDaysFromStartOfWeek()
Set the day (keeping the current time) to the start of the week + the number of days passed as the first parameter. First day of week is driven by the locale unless explicitly set with the second parameter.
public
setDaysFromStartOfWeek(int $numberOfDays[, WeekDay|int|null $weekStartsAt = null ]) : static
Parameters
- $numberOfDays : int
-
number of days to add after the start of the current week
- $weekStartsAt : WeekDay|int|null = null
-
optional start allow you to specify the day of week to use to start the week, if not provided, start of week is inferred from the locale (Sunday for en_US, Monday for de_DE, etc.)
Return values
staticsetHour()
public
setHour(int $value) : CarbonInterface
Set current instance hour to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetHours()
public
setHours(int $value) : CarbonInterface
Set current instance hour to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetISODate()
Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
public
setISODate(int $year, int $week[, int $day = 1 ]) : static
Parameters
- $year : int
- $week : int
- $day : int = 1
Tags
Return values
staticsetMicro()
public
setMicro(int $value) : CarbonInterface
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMicros()
public
setMicros(int $value) : CarbonInterface
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMicrosecond()
public
setMicrosecond(int $value) : CarbonInterface
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMicroseconds()
public
setMicroseconds(int $value) : CarbonInterface
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMilli()
public
setMilli(int $value) : CarbonInterface
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMillis()
public
setMillis(int $value) : CarbonInterface
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMillisecond()
public
setMillisecond(int $value) : CarbonInterface
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMilliseconds()
public
setMilliseconds(int $value) : CarbonInterface
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMinute()
public
setMinute(int $value) : CarbonInterface
Set current instance minute to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMinutes()
public
setMinutes(int $value) : CarbonInterface
Set current instance minute to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetMonth()
public
setMonth(Month|int $value) : CarbonInterface
Set current instance month to the given value.
Parameters
- $value : Month|int
Return values
CarbonInterfacesetMonths()
public
setMonths(Month|int $value) : CarbonInterface
Set current instance month to the given value.
Parameters
- $value : Month|int
Return values
CarbonInterfacesetSecond()
public
setSecond(int $value) : CarbonInterface
Set current instance second to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetSeconds()
public
setSeconds(int $value) : CarbonInterface
Set current instance second to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetTime()
Resets the current time of the DateTime object to a different time.
public
setTime(int $hour, int $minute[, int $second = 0 ][, int $microseconds = 0 ]) : static
Parameters
- $hour : int
- $minute : int
- $second : int = 0
- $microseconds : int = 0
Tags
Return values
staticsetTimeFrom()
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
public
setTimeFrom(DateTimeInterface|string $date) : static
Parameters
- $date : DateTimeInterface|string
Return values
staticsetTimeFromTimeString()
Set the time by time string.
public
setTimeFromTimeString(string $time) : static
Parameters
- $time : string
Return values
staticsetTimestamp()
Set the instance's timestamp.
public
setTimestamp(float|int|string $timestamp) : static
Timestamp input can be given as int, float or a string containing one or more numbers.
Parameters
- $timestamp : float|int|string
Return values
staticsetTimezone()
Set the instance's timezone from a string or object.
public
setTimezone(DateTimeZone|string|int $timeZone) : static
Parameters
- $timeZone : DateTimeZone|string|int
Return values
staticsetUnit()
Set specified unit to new given value.
public
setUnit(string $unit[, Month|int $value = null ]) : static
Parameters
- $unit : string
-
year, month, day, hour, minute, second or microsecond
- $value : Month|int = null
-
new value for given unit
Return values
staticsetUnitNoOverflow()
Set any unit to a new value without overflowing current other unit given.
public
setUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit) : static
Parameters
- $valueUnit : string
-
unit name to modify
- $value : int
-
new value for the input unit
- $overflowUnit : string
-
unit name to not overflow
Return values
staticsetWeekendDays()
public
static setWeekendDays(array<string|int, mixed> $days) : void
Parameters
- $days : array<string|int, mixed>
Tags
setYear()
public
setYear(int $value) : CarbonInterface
Set current instance year to the given value.
Parameters
- $value : int
Return values
CarbonInterfacesetYears()
public
setYears(int $value) : CarbonInterface
Set current instance year to the given value.
Parameters
- $value : int
Return values
CarbonInterfaceshiftTimezone()
Set the instance's timezone from a string or object and add/subtract the offset difference.
public
shiftTimezone(DateTimeZone|string $value) : static
Parameters
- $value : DateTimeZone|string
Return values
staticshortAbsoluteDiffForHumans()
public
shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) : string
Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Parameters
- $other = null : DateTimeInterface
- $parts = 1 : int
Return values
stringshortRelativeDiffForHumans()
public
shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) : string
Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Parameters
- $other = null : DateTimeInterface
- $parts = 1 : int
Return values
stringshortRelativeToNowDiffForHumans()
public
shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) : string
Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Parameters
- $other = null : DateTimeInterface
- $parts = 1 : int
Return values
stringshortRelativeToOtherDiffForHumans()
public
shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) : string
Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Parameters
- $other = null : DateTimeInterface
- $parts = 1 : int
Return values
stringsingularUnit()
Returns standardized singular of a given singular/plural unit name (in English).
public
static singularUnit(string $unit) : string
Parameters
- $unit : string
Return values
stringsleep()
public
static sleep(int|float $seconds) : void
Parameters
- $seconds : int|float
subCenturies()
public
subCenturies(int|float $value = 1) : CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubCenturiesNoOverflow()
public
subCenturiesNoOverflow(int|float $value = 1) : CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubCenturiesWithNoOverflow()
public
subCenturiesWithNoOverflow(int|float $value = 1) : CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubCenturiesWithoutOverflow()
public
subCenturiesWithoutOverflow(int|float $value = 1) : CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubCenturiesWithOverflow()
public
subCenturiesWithOverflow(int|float $value = 1) : CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubCentury()
public
subCentury() : CarbonInterface
Sub one century to the instance (using date interval).
Return values
CarbonInterfacesubCenturyNoOverflow()
public
subCenturyNoOverflow() : CarbonInterface
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubCenturyWithNoOverflow()
public
subCenturyWithNoOverflow() : CarbonInterface
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubCenturyWithoutOverflow()
public
subCenturyWithoutOverflow() : CarbonInterface
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubCenturyWithOverflow()
public
subCenturyWithOverflow() : CarbonInterface
Sub one century to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfacesubDay()
public
subDay() : CarbonInterface
Sub one day to the instance (using date interval).
Return values
CarbonInterfacesubDays()
public
subDays(int|float $value = 1) : CarbonInterface
Sub days (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubDecade()
public
subDecade() : CarbonInterface
Sub one decade to the instance (using date interval).
Return values
CarbonInterfacesubDecadeNoOverflow()
public
subDecadeNoOverflow() : CarbonInterface
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubDecades()
public
subDecades(int|float $value = 1) : CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubDecadesNoOverflow()
public
subDecadesNoOverflow(int|float $value = 1) : CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubDecadesWithNoOverflow()
public
subDecadesWithNoOverflow(int|float $value = 1) : CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubDecadesWithoutOverflow()
public
subDecadesWithoutOverflow(int|float $value = 1) : CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubDecadesWithOverflow()
public
subDecadesWithOverflow(int|float $value = 1) : CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubDecadeWithNoOverflow()
public
subDecadeWithNoOverflow() : CarbonInterface
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubDecadeWithoutOverflow()
public
subDecadeWithoutOverflow() : CarbonInterface
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubDecadeWithOverflow()
public
subDecadeWithOverflow() : CarbonInterface
Sub one decade to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfacesubHour()
public
subHour() : CarbonInterface
Sub one hour to the instance (using date interval).
Return values
CarbonInterfacesubHours()
public
subHours(int|float $value = 1) : CarbonInterface
Sub hours (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMicro()
public
subMicro() : CarbonInterface
Sub one microsecond to the instance (using date interval).
Return values
CarbonInterfacesubMicros()
public
subMicros(int|float $value = 1) : CarbonInterface
Sub microseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMicrosecond()
public
subMicrosecond() : CarbonInterface
Sub one microsecond to the instance (using date interval).
Return values
CarbonInterfacesubMicroseconds()
public
subMicroseconds(int|float $value = 1) : CarbonInterface
Sub microseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMillennia()
public
subMillennia(int|float $value = 1) : CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMillenniaNoOverflow()
public
subMillenniaNoOverflow(int|float $value = 1) : CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMillenniaWithNoOverflow()
public
subMillenniaWithNoOverflow(int|float $value = 1) : CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMillenniaWithoutOverflow()
public
subMillenniaWithoutOverflow(int|float $value = 1) : CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMillenniaWithOverflow()
public
subMillenniaWithOverflow(int|float $value = 1) : CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMillennium()
public
subMillennium() : CarbonInterface
Sub one millennium to the instance (using date interval).
Return values
CarbonInterfacesubMillenniumNoOverflow()
public
subMillenniumNoOverflow() : CarbonInterface
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubMillenniumWithNoOverflow()
public
subMillenniumWithNoOverflow() : CarbonInterface
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubMillenniumWithoutOverflow()
public
subMillenniumWithoutOverflow() : CarbonInterface
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubMillenniumWithOverflow()
public
subMillenniumWithOverflow() : CarbonInterface
Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfacesubMilli()
public
subMilli() : CarbonInterface
Sub one millisecond to the instance (using date interval).
Return values
CarbonInterfacesubMillis()
public
subMillis(int|float $value = 1) : CarbonInterface
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMillisecond()
public
subMillisecond() : CarbonInterface
Sub one millisecond to the instance (using date interval).
Return values
CarbonInterfacesubMilliseconds()
public
subMilliseconds(int|float $value = 1) : CarbonInterface
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMinute()
public
subMinute() : CarbonInterface
Sub one minute to the instance (using date interval).
Return values
CarbonInterfacesubMinutes()
public
subMinutes(int|float $value = 1) : CarbonInterface
Sub minutes (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMonth()
public
subMonth() : CarbonInterface
Sub one month to the instance (using date interval).
Return values
CarbonInterfacesubMonthNoOverflow()
public
subMonthNoOverflow() : CarbonInterface
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubMonths()
public
subMonths(int|float $value = 1) : CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMonthsNoOverflow()
public
subMonthsNoOverflow(int|float $value = 1) : CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMonthsWithNoOverflow()
public
subMonthsWithNoOverflow(int|float $value = 1) : CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMonthsWithoutOverflow()
public
subMonthsWithoutOverflow(int|float $value = 1) : CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMonthsWithOverflow()
public
subMonthsWithOverflow(int|float $value = 1) : CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubMonthWithNoOverflow()
public
subMonthWithNoOverflow() : CarbonInterface
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubMonthWithoutOverflow()
public
subMonthWithoutOverflow() : CarbonInterface
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubMonthWithOverflow()
public
subMonthWithOverflow() : CarbonInterface
Sub one month to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfacesubQuarter()
public
subQuarter() : CarbonInterface
Sub one quarter to the instance (using date interval).
Return values
CarbonInterfacesubQuarterNoOverflow()
public
subQuarterNoOverflow() : CarbonInterface
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubQuarters()
public
subQuarters(int|float $value = 1) : CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubQuartersNoOverflow()
public
subQuartersNoOverflow(int|float $value = 1) : CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubQuartersWithNoOverflow()
public
subQuartersWithNoOverflow(int|float $value = 1) : CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubQuartersWithoutOverflow()
public
subQuartersWithoutOverflow(int|float $value = 1) : CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubQuartersWithOverflow()
public
subQuartersWithOverflow(int|float $value = 1) : CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubQuarterWithNoOverflow()
public
subQuarterWithNoOverflow() : CarbonInterface
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubQuarterWithoutOverflow()
public
subQuarterWithoutOverflow() : CarbonInterface
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubQuarterWithOverflow()
public
subQuarterWithOverflow() : CarbonInterface
Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfacesubSecond()
public
subSecond() : CarbonInterface
Sub one second to the instance (using date interval).
Return values
CarbonInterfacesubSeconds()
public
subSeconds(int|float $value = 1) : CarbonInterface
Sub seconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUnitNoOverflow()
Subtract any unit to a new value without overflowing current other unit given.
public
subUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit) : static
Parameters
- $valueUnit : string
-
unit name to modify
- $value : int
-
amount to subtract to the input unit
- $overflowUnit : string
-
unit name to not overflow
Return values
staticsubUTCCenturies()
public
subUTCCenturies(int|float $value = 1) : CarbonInterface
Sub centuries (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCCentury()
public
subUTCCentury() : CarbonInterface
Sub one century to the instance (using timestamp).
Return values
CarbonInterfacesubUTCDay()
public
subUTCDay() : CarbonInterface
Sub one day to the instance (using timestamp).
Return values
CarbonInterfacesubUTCDays()
public
subUTCDays(int|float $value = 1) : CarbonInterface
Sub days (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCDecade()
public
subUTCDecade() : CarbonInterface
Sub one decade to the instance (using timestamp).
Return values
CarbonInterfacesubUTCDecades()
public
subUTCDecades(int|float $value = 1) : CarbonInterface
Sub decades (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCHour()
public
subUTCHour() : CarbonInterface
Sub one hour to the instance (using timestamp).
Return values
CarbonInterfacesubUTCHours()
public
subUTCHours(int|float $value = 1) : CarbonInterface
Sub hours (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCMicro()
public
subUTCMicro() : CarbonInterface
Sub one microsecond to the instance (using timestamp).
Return values
CarbonInterfacesubUTCMicros()
public
subUTCMicros(int|float $value = 1) : CarbonInterface
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCMicrosecond()
public
subUTCMicrosecond() : CarbonInterface
Sub one microsecond to the instance (using timestamp).
Return values
CarbonInterfacesubUTCMicroseconds()
public
subUTCMicroseconds(int|float $value = 1) : CarbonInterface
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCMillennia()
public
subUTCMillennia(int|float $value = 1) : CarbonInterface
Sub millennia (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCMillennium()
public
subUTCMillennium() : CarbonInterface
Sub one millennium to the instance (using timestamp).
Return values
CarbonInterfacesubUTCMilli()
public
subUTCMilli() : CarbonInterface
Sub one millisecond to the instance (using timestamp).
Return values
CarbonInterfacesubUTCMillis()
public
subUTCMillis(int|float $value = 1) : CarbonInterface
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCMillisecond()
public
subUTCMillisecond() : CarbonInterface
Sub one millisecond to the instance (using timestamp).
Return values
CarbonInterfacesubUTCMilliseconds()
public
subUTCMilliseconds(int|float $value = 1) : CarbonInterface
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCMinute()
public
subUTCMinute() : CarbonInterface
Sub one minute to the instance (using timestamp).
Return values
CarbonInterfacesubUTCMinutes()
public
subUTCMinutes(int|float $value = 1) : CarbonInterface
Sub minutes (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCMonth()
public
subUTCMonth() : CarbonInterface
Sub one month to the instance (using timestamp).
Return values
CarbonInterfacesubUTCMonths()
public
subUTCMonths(int|float $value = 1) : CarbonInterface
Sub months (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCQuarter()
public
subUTCQuarter() : CarbonInterface
Sub one quarter to the instance (using timestamp).
Return values
CarbonInterfacesubUTCQuarters()
public
subUTCQuarters(int|float $value = 1) : CarbonInterface
Sub quarters (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCSecond()
public
subUTCSecond() : CarbonInterface
Sub one second to the instance (using timestamp).
Return values
CarbonInterfacesubUTCSeconds()
public
subUTCSeconds(int|float $value = 1) : CarbonInterface
Sub seconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCWeek()
public
subUTCWeek() : CarbonInterface
Sub one week to the instance (using timestamp).
Return values
CarbonInterfacesubUTCWeeks()
public
subUTCWeeks(int|float $value = 1) : CarbonInterface
Sub weeks (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubUTCYear()
public
subUTCYear() : CarbonInterface
Sub one year to the instance (using timestamp).
Return values
CarbonInterfacesubUTCYears()
public
subUTCYears(int|float $value = 1) : CarbonInterface
Sub years (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubWeek()
public
subWeek() : CarbonInterface
Sub one week to the instance (using date interval).
Return values
CarbonInterfacesubWeekday()
public
subWeekday() : CarbonInterface
Sub one weekday to the instance (using date interval).
Return values
CarbonInterfacesubWeekdays()
public
subWeekdays(int|float $value = 1) : CarbonInterface
Sub weekdays (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubWeeks()
public
subWeeks(int|float $value = 1) : CarbonInterface
Sub weeks (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubYear()
public
subYear() : CarbonInterface
Sub one year to the instance (using date interval).
Return values
CarbonInterfacesubYearNoOverflow()
public
subYearNoOverflow() : CarbonInterface
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubYears()
public
subYears(int|float $value = 1) : CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubYearsNoOverflow()
public
subYearsNoOverflow(int|float $value = 1) : CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubYearsWithNoOverflow()
public
subYearsWithNoOverflow(int|float $value = 1) : CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubYearsWithoutOverflow()
public
subYearsWithoutOverflow(int|float $value = 1) : CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubYearsWithOverflow()
public
subYearsWithOverflow(int|float $value = 1) : CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int|float
Return values
CarbonInterfacesubYearWithNoOverflow()
public
subYearWithNoOverflow() : CarbonInterface
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubYearWithoutOverflow()
public
subYearWithoutOverflow() : CarbonInterface
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonInterfacesubYearWithOverflow()
public
subYearWithOverflow() : CarbonInterface
Sub one year to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonInterfacetimezone()
public
timezone(DateTimeZone|string|int $value) : static
Parameters
- $value : DateTimeZone|string|int
Tags
Return values
statictranslatedFormat()
Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) but translate words whenever possible (months, day names, etc.) using the current locale.
public
translatedFormat(string $format) : string
Parameters
- $format : string
Return values
stringtz()
Set the timezone or returns the timezone name if no arguments passed.
public
tz([DateTimeZone|string|int|null $value = null ]) : static|string
Parameters
- $value : DateTimeZone|string|int|null = null
Return values
static|stringutc()
Set the instance's timezone to UTC.
public
utc() : static
Return values
staticutcOffset()
Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
public
utcOffset([int|null $minuteOffset = null ]) : static|int
Parameters
- $minuteOffset : int|null = null
Return values
static|intweekday()
Get/set the weekday from 0 (Sunday) to 6 (Saturday).
public
weekday([WeekDay|int|null $value = null ]) : static|int
Parameters
- $value : WeekDay|int|null = null
-
new value for weekday if using as setter.
Return values
static|intweekOfCentury()
public
weekOfCentury(int|null $week = null) : int|static
Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value
Parameters
- $week = null : int|null
Return values
int|staticweekOfDecade()
public
weekOfDecade(int|null $week = null) : int|static
Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value
Parameters
- $week = null : int|null
Return values
int|staticweekOfMillennium()
public
weekOfMillennium(int|null $week = null) : int|static
Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value
Parameters
- $week = null : int|null
Return values
int|staticweekOfMonth()
public
weekOfMonth(int|null $week = null) : int|static
Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value
Parameters
- $week = null : int|null
Return values
int|staticweekOfQuarter()
public
weekOfQuarter(int|null $week = null) : int|static
Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value
Parameters
- $week = null : int|null
Return values
int|staticweekOfYear()
public
weekOfYear(int|null $week = null) : int|static
Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value
Parameters
- $week = null : int|null
Return values
int|staticweeksInCentury()
public
weeksInCentury() : int
Return the number of weeks contained in the current century
Return values
intweeksInDecade()
public
weeksInDecade() : int
Return the number of weeks contained in the current decade
Return values
intweeksInMillennium()
public
weeksInMillennium() : int
Return the number of weeks contained in the current millennium
Return values
intweeksInMonth()
public
weeksInMonth() : int
Return the number of weeks contained in the current month
Return values
intweeksInQuarter()
public
weeksInQuarter() : int
Return the number of weeks contained in the current quarter
Return values
intweeksUntil()
public
weeksUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodyear()
public
year(int $value) : CarbonInterface
Set current instance year to the given value.
Parameters
- $value : int
Return values
CarbonInterfaceyearOfCentury()
public
yearOfCentury(int|null $year = null) : int|static
Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value
Parameters
- $year = null : int|null
Return values
int|staticyearOfDecade()
public
yearOfDecade(int|null $year = null) : int|static
Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value
Parameters
- $year = null : int|null
Return values
int|staticyearOfMillennium()
public
yearOfMillennium(int|null $year = null) : int|static
Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value
Parameters
- $year = null : int|null
Return values
int|staticyears()
public
years(int $value) : CarbonInterface
Set current instance year to the given value.
Parameters
- $value : int
Return values
CarbonInterfaceyearsInCentury()
public
yearsInCentury() : int
Return the number of years contained in the current century
Return values
intyearsInDecade()
public
yearsInDecade() : int
Return the number of years contained in the current decade
Return values
intyearsInMillennium()
public
yearsInMillennium() : int
Return the number of years contained in the current millennium
Return values
intyearsUntil()
public
yearsUntil(mixed $endDate, int|float $factor = 1) : CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given.
Parameters
- $endDate : mixed
- $factor = 1 : int|float
Return values
CarbonPeriodexecuteCallable()
protected
executeCallable(callable $macro, mixed ...$parameters) : mixed
Parameters
- $macro : callable
- $parameters : mixed
executeCallableWithContext()
protected
executeCallableWithContext(callable $macro, mixed ...$parameters) : mixed
Parameters
- $macro : callable
- $parameters : mixed
executeStaticCallable()
protected
static executeStaticCallable(callable $macro, mixed ...$parameters) : mixed
Parameters
- $macro : callable
- $parameters : mixed
getAllGenericMacros()
protected
getAllGenericMacros() : Generator
Return values
GeneratorgetGenericMacros()
protected
static getGenericMacros() : Generator
Return values
GeneratorgetRangesByUnit()
List of minimum and maximums for each unit.
protected
static getRangesByUnit([int $daysInMonth = 31 ]) : array<string|int, mixed>
Parameters
- $daysInMonth : int = 31
Return values
array<string|int, mixed>getTranslatedFormByRegExp()
protected
getTranslatedFormByRegExp(mixed $baseKey, mixed $keySuffix, mixed $context, mixed $subKey, mixed $defaultValue) : mixed
Parameters
- $baseKey : mixed
- $keySuffix : mixed
- $context : mixed
- $subKey : mixed
- $defaultValue : mixed
resolveCarbon()
Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
protected
resolveCarbon(DateTimeInterface|string|null $date) : self
Parameters
- $date : DateTimeInterface|string|null
Return values
selfsafeCreateDateTimeZone()
Creates a DateTimeZone from a string, DateTimeZone or integer offset.
protected
static safeCreateDateTimeZone(DateTimeZone|string|int|false|null $object[, DateTimeZone|string|int|false|null $objectDump = null ]) : CarbonTimeZone|null
Parameters
- $object : DateTimeZone|string|int|false|null
-
original value to get CarbonTimeZone from it.
- $objectDump : DateTimeZone|string|int|false|null = null
-
dump of the object for error messages.
Tags
Return values
CarbonTimeZone|nullweekRotate()
protected
static weekRotate(int $day, int $rotation) : int
Parameters
- $day : int
- $rotation : int
Return values
intcallComparatorMethod()
private
callComparatorMethod(string $unit, array<string|int, mixed> $parameters) : bool|null
Parameters
- $unit : string
- $parameters : array<string|int, mixed>
Return values
bool|nullcallDiffAlias()
private
callDiffAlias(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
callGetOrSet()
private
callGetOrSet(string $name, mixed $value) : mixed
Parameters
- $name : string
- $value : mixed
callGetOrSetMethod()
private
callGetOrSetMethod(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
callHumanDiffAlias()
private
callHumanDiffAlias(string $method, array<string|int, mixed> $parameters) : string|null
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Return values
string|nullcallIsMethod()
private
callIsMethod(string $unit, array<string|int, mixed> $parameters) : bool|null
Parameters
- $unit : string
- $parameters : array<string|int, mixed>
Return values
bool|nullcallMacroMethod()
private
callMacroMethod(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
callModifierMethod()
private
callModifierMethod(string $unit, array<string|int, mixed> $parameters) : static|null
Parameters
- $unit : string
- $parameters : array<string|int, mixed>
Return values
static|nullcallPeriodMethod()
private
callPeriodMethod(string $method, array<string|int, mixed> $parameters) : CarbonPeriod|null
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Return values
CarbonPeriod|nullfloorZeroPad()
private
static floorZeroPad(int|float $value, int $length) : string
Parameters
- $value : int|float
- $length : int
Return values
stringgetUTCUnit()
private
getUTCUnit(string $unit) : string|null
Parameters
- $unit : string