CarbonImmutable
extends DateTimeImmutable
in package
implements
CarbonInterface
Uses
Date
A simple API extension for DateTimeImmutable.
<autodoc generated by composer phpdoc
>
Interfaces, Classes, Traits and Enums
- CarbonInterface
- Common interface for Carbon and CarbonImmutable.
Table of Contents
- $age : int
- $century : int
- $day : int
- $dayName : string
- $dayOfWeek : int
- $dayOfWeekIso : int
- $dayOfYear : int
- $daysInMonth : int
- $daysInYear : int
- $decade : int
- $dst : bool
- $englishDayOfWeek : string
- $englishMonth : string
- $firstWeekDay : int
- $hour : 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
- $millennium : int
- $milli : int
- $millisecond : int
- $milliseconds : int
- $minDayName : string
- $minute : int
- $month : int
- $monthName : string
- $noZeroHour : int
- $offset : int
- $offsetHours : int
- $offsetMinutes : int
- $quarter : int
- $second : int
- $shortDayName : string
- $shortEnglishDayOfWeek : string
- $shortEnglishMonth : string
- $shortLocaleDayOfWeek : string
- $shortLocaleMonth : string
- $shortMonthName : string
- $timestamp : int
- $timezone : CarbonTimeZone
- $timezoneAbbreviatedName : string
- $timezoneName : string
- $tz : CarbonTimeZone
- $tzAbbrName : string
- $tzName : string
- $upperMeridiem : string
- $utc : bool
- $week : int
- $weekNumberInMonth : int
- $weekOfMonth : int
- $weekOfYear : int
- $weeksInYear : int
- $weekYear : int
- $year : int
- $yearIso : 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.
- $utf8 : bool
- Will UTF8 encoding be used to print localized date/time ?
- __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
- __set_state() : static
- The __set_state handler.
- addCenturies() : CarbonImmutable
- addCenturiesNoOverflow() : CarbonImmutable
- addCenturiesWithNoOverflow() : CarbonImmutable
- addCenturiesWithoutOverflow() : CarbonImmutable
- addCenturiesWithOverflow() : CarbonImmutable
- addCentury() : CarbonImmutable
- addCenturyNoOverflow() : CarbonImmutable
- addCenturyWithNoOverflow() : CarbonImmutable
- addCenturyWithoutOverflow() : CarbonImmutable
- addCenturyWithOverflow() : CarbonImmutable
- addDay() : CarbonImmutable
- addDays() : CarbonImmutable
- addDecade() : CarbonImmutable
- addDecadeNoOverflow() : CarbonImmutable
- addDecades() : CarbonImmutable
- addDecadesNoOverflow() : CarbonImmutable
- addDecadesWithNoOverflow() : CarbonImmutable
- addDecadesWithoutOverflow() : CarbonImmutable
- addDecadesWithOverflow() : CarbonImmutable
- addDecadeWithNoOverflow() : CarbonImmutable
- addDecadeWithoutOverflow() : CarbonImmutable
- addDecadeWithOverflow() : CarbonImmutable
- addHour() : CarbonImmutable
- addHours() : CarbonImmutable
- addMicro() : CarbonImmutable
- addMicros() : CarbonImmutable
- addMicrosecond() : CarbonImmutable
- addMicroseconds() : CarbonImmutable
- addMillennia() : CarbonImmutable
- addMillenniaNoOverflow() : CarbonImmutable
- addMillenniaWithNoOverflow() : CarbonImmutable
- addMillenniaWithoutOverflow() : CarbonImmutable
- addMillenniaWithOverflow() : CarbonImmutable
- addMillennium() : CarbonImmutable
- addMillenniumNoOverflow() : CarbonImmutable
- addMillenniumWithNoOverflow() : CarbonImmutable
- addMillenniumWithoutOverflow() : CarbonImmutable
- addMillenniumWithOverflow() : CarbonImmutable
- addMilli() : CarbonImmutable
- addMillis() : CarbonImmutable
- addMillisecond() : CarbonImmutable
- addMilliseconds() : CarbonImmutable
- addMinute() : CarbonImmutable
- addMinutes() : CarbonImmutable
- addMonth() : CarbonImmutable
- addMonthNoOverflow() : CarbonImmutable
- addMonths() : CarbonImmutable
- addMonthsNoOverflow() : CarbonImmutable
- addMonthsWithNoOverflow() : CarbonImmutable
- addMonthsWithoutOverflow() : CarbonImmutable
- addMonthsWithOverflow() : CarbonImmutable
- addMonthWithNoOverflow() : CarbonImmutable
- addMonthWithoutOverflow() : CarbonImmutable
- addMonthWithOverflow() : CarbonImmutable
- addQuarter() : CarbonImmutable
- addQuarterNoOverflow() : CarbonImmutable
- addQuarters() : CarbonImmutable
- addQuartersNoOverflow() : CarbonImmutable
- addQuartersWithNoOverflow() : CarbonImmutable
- addQuartersWithoutOverflow() : CarbonImmutable
- addQuartersWithOverflow() : CarbonImmutable
- addQuarterWithNoOverflow() : CarbonImmutable
- addQuarterWithoutOverflow() : CarbonImmutable
- addQuarterWithOverflow() : CarbonImmutable
- addRealCenturies() : CarbonImmutable
- addRealCentury() : CarbonImmutable
- addRealDay() : CarbonImmutable
- addRealDays() : CarbonImmutable
- addRealDecade() : CarbonImmutable
- addRealDecades() : CarbonImmutable
- addRealHour() : CarbonImmutable
- addRealHours() : CarbonImmutable
- addRealMicro() : CarbonImmutable
- addRealMicros() : CarbonImmutable
- addRealMicrosecond() : CarbonImmutable
- addRealMicroseconds() : CarbonImmutable
- addRealMillennia() : CarbonImmutable
- addRealMillennium() : CarbonImmutable
- addRealMilli() : CarbonImmutable
- addRealMillis() : CarbonImmutable
- addRealMillisecond() : CarbonImmutable
- addRealMilliseconds() : CarbonImmutable
- addRealMinute() : CarbonImmutable
- addRealMinutes() : CarbonImmutable
- addRealMonth() : CarbonImmutable
- addRealMonths() : CarbonImmutable
- addRealQuarter() : CarbonImmutable
- addRealQuarters() : CarbonImmutable
- addRealSecond() : CarbonImmutable
- addRealSeconds() : CarbonImmutable
- addRealWeek() : CarbonImmutable
- addRealWeeks() : CarbonImmutable
- addRealYear() : CarbonImmutable
- addRealYears() : CarbonImmutable
- addSecond() : CarbonImmutable
- addSeconds() : CarbonImmutable
- addUnitNoOverflow() : static
- Add any unit to a new value without overflowing current other unit given.
- addWeek() : CarbonImmutable
- addWeekday() : CarbonImmutable
- addWeekdays() : CarbonImmutable
- addWeeks() : CarbonImmutable
- addYear() : CarbonImmutable
- addYearNoOverflow() : CarbonImmutable
- addYears() : CarbonImmutable
- addYearsNoOverflow() : CarbonImmutable
- addYearsWithNoOverflow() : CarbonImmutable
- addYearsWithoutOverflow() : CarbonImmutable
- addYearsWithOverflow() : CarbonImmutable
- addYearWithNoOverflow() : CarbonImmutable
- addYearWithoutOverflow() : CarbonImmutable
- addYearWithOverflow() : CarbonImmutable
- 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() : CarbonImmutable
- ceilCentury() : CarbonImmutable
- ceilDay() : CarbonImmutable
- ceilDays() : CarbonImmutable
- ceilDecade() : CarbonImmutable
- ceilDecades() : CarbonImmutable
- ceilHour() : CarbonImmutable
- ceilHours() : CarbonImmutable
- ceilMicrosecond() : CarbonImmutable
- ceilMicroseconds() : CarbonImmutable
- ceilMillennia() : CarbonImmutable
- ceilMillennium() : CarbonImmutable
- ceilMillisecond() : CarbonImmutable
- ceilMilliseconds() : CarbonImmutable
- ceilMinute() : CarbonImmutable
- ceilMinutes() : CarbonImmutable
- ceilMonth() : CarbonImmutable
- ceilMonths() : CarbonImmutable
- ceilQuarter() : CarbonImmutable
- ceilQuarters() : CarbonImmutable
- ceilSecond() : CarbonImmutable
- ceilSeconds() : CarbonImmutable
- ceilYear() : CarbonImmutable
- ceilYears() : CarbonImmutable
- centuriesUntil() : CarbonPeriod
- clone() : static
- copy() : static
- Get a copy of the instance.
- createFromFormat() : static|false
- Create a Carbon instance from a specific format.
- createFromMutable() : CarbonImmutable
- day() : CarbonImmutable
- dayOfYear() : static|int
- Get/set the day of year.
- days() : CarbonImmutable
- daysUntil() : CarbonPeriod
- decadesUntil() : CarbonPeriod
- floorCenturies() : CarbonImmutable
- floorCentury() : CarbonImmutable
- floorDay() : CarbonImmutable
- floorDays() : CarbonImmutable
- floorDecade() : CarbonImmutable
- floorDecades() : CarbonImmutable
- floorHour() : CarbonImmutable
- floorHours() : CarbonImmutable
- floorMicrosecond() : CarbonImmutable
- floorMicroseconds() : CarbonImmutable
- floorMillennia() : CarbonImmutable
- floorMillennium() : CarbonImmutable
- floorMillisecond() : CarbonImmutable
- floorMilliseconds() : CarbonImmutable
- floorMinute() : CarbonImmutable
- floorMinutes() : CarbonImmutable
- floorMonth() : CarbonImmutable
- floorMonths() : CarbonImmutable
- floorQuarter() : CarbonImmutable
- floorQuarters() : CarbonImmutable
- floorSecond() : CarbonImmutable
- floorSeconds() : CarbonImmutable
- floorYear() : CarbonImmutable
- floorYears() : CarbonImmutable
- formatLocalized() : string
- Format the instance with the current locale. You can set the current locale using setlocale() http://php.net/setlocale.
- get() : string|int|bool|DateTimeZone|null
- 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
- 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() : CarbonImmutable
- hours() : CarbonImmutable
- hoursUntil() : CarbonPeriod
- isCurrentCentury() : bool
- isCurrentDay() : bool
- isCurrentDecade() : bool
- isCurrentHour() : bool
- isCurrentMicro() : bool
- isCurrentMicrosecond() : bool
- isCurrentMillennium() : 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
- 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
- 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
- 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() : CarbonImmutable
- micros() : CarbonImmutable
- microsecond() : CarbonImmutable
- microseconds() : CarbonImmutable
- microsecondsUntil() : CarbonPeriod
- microsUntil() : CarbonPeriod
- millenniaUntil() : CarbonPeriod
- milli() : CarbonImmutable
- millis() : CarbonImmutable
- millisecond() : CarbonImmutable
- milliseconds() : CarbonImmutable
- millisecondsUntil() : CarbonPeriod
- millisUntil() : CarbonPeriod
- minute() : CarbonImmutable
- minutes() : CarbonImmutable
- minutesUntil() : CarbonPeriod
- month() : CarbonImmutable
- months() : CarbonImmutable
- 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).
- quartersUntil() : CarbonPeriod
- roundCenturies() : CarbonImmutable
- roundCentury() : CarbonImmutable
- roundDay() : CarbonImmutable
- roundDays() : CarbonImmutable
- roundDecade() : CarbonImmutable
- roundDecades() : CarbonImmutable
- roundHour() : CarbonImmutable
- roundHours() : CarbonImmutable
- roundMicrosecond() : CarbonImmutable
- roundMicroseconds() : CarbonImmutable
- roundMillennia() : CarbonImmutable
- roundMillennium() : CarbonImmutable
- roundMillisecond() : CarbonImmutable
- roundMilliseconds() : CarbonImmutable
- roundMinute() : CarbonImmutable
- roundMinutes() : CarbonImmutable
- roundMonth() : CarbonImmutable
- roundMonths() : CarbonImmutable
- roundQuarter() : CarbonImmutable
- roundQuarters() : CarbonImmutable
- roundSecond() : CarbonImmutable
- roundSeconds() : CarbonImmutable
- roundYear() : CarbonImmutable
- roundYears() : CarbonImmutable
- second() : CarbonImmutable
- seconds() : CarbonImmutable
- 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() : CarbonImmutable
- setDays() : CarbonImmutable
- setHour() : CarbonImmutable
- setHours() : CarbonImmutable
- setISODate() : static
- Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
- setMicro() : CarbonImmutable
- setMicros() : CarbonImmutable
- setMicrosecond() : CarbonImmutable
- setMicroseconds() : CarbonImmutable
- setMilli() : CarbonImmutable
- setMillis() : CarbonImmutable
- setMillisecond() : CarbonImmutable
- setMilliseconds() : CarbonImmutable
- setMinute() : CarbonImmutable
- setMinutes() : CarbonImmutable
- setMonth() : CarbonImmutable
- setMonths() : CarbonImmutable
- setSecond() : CarbonImmutable
- setSeconds() : CarbonImmutable
- 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
- Sets the date and time based on an Unix 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.
- setUtf8() : mixed
- setWeekendDays() : void
- setWeekEndsAt() : void
- setWeekStartsAt() : void
- setYear() : CarbonImmutable
- setYears() : CarbonImmutable
- 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).
- subCenturies() : CarbonImmutable
- subCenturiesNoOverflow() : CarbonImmutable
- subCenturiesWithNoOverflow() : CarbonImmutable
- subCenturiesWithoutOverflow() : CarbonImmutable
- subCenturiesWithOverflow() : CarbonImmutable
- subCentury() : CarbonImmutable
- subCenturyNoOverflow() : CarbonImmutable
- subCenturyWithNoOverflow() : CarbonImmutable
- subCenturyWithoutOverflow() : CarbonImmutable
- subCenturyWithOverflow() : CarbonImmutable
- subDay() : CarbonImmutable
- subDays() : CarbonImmutable
- subDecade() : CarbonImmutable
- subDecadeNoOverflow() : CarbonImmutable
- subDecades() : CarbonImmutable
- subDecadesNoOverflow() : CarbonImmutable
- subDecadesWithNoOverflow() : CarbonImmutable
- subDecadesWithoutOverflow() : CarbonImmutable
- subDecadesWithOverflow() : CarbonImmutable
- subDecadeWithNoOverflow() : CarbonImmutable
- subDecadeWithoutOverflow() : CarbonImmutable
- subDecadeWithOverflow() : CarbonImmutable
- subHour() : CarbonImmutable
- subHours() : CarbonImmutable
- subMicro() : CarbonImmutable
- subMicros() : CarbonImmutable
- subMicrosecond() : CarbonImmutable
- subMicroseconds() : CarbonImmutable
- subMillennia() : CarbonImmutable
- subMillenniaNoOverflow() : CarbonImmutable
- subMillenniaWithNoOverflow() : CarbonImmutable
- subMillenniaWithoutOverflow() : CarbonImmutable
- subMillenniaWithOverflow() : CarbonImmutable
- subMillennium() : CarbonImmutable
- subMillenniumNoOverflow() : CarbonImmutable
- subMillenniumWithNoOverflow() : CarbonImmutable
- subMillenniumWithoutOverflow() : CarbonImmutable
- subMillenniumWithOverflow() : CarbonImmutable
- subMilli() : CarbonImmutable
- subMillis() : CarbonImmutable
- subMillisecond() : CarbonImmutable
- subMilliseconds() : CarbonImmutable
- subMinute() : CarbonImmutable
- subMinutes() : CarbonImmutable
- subMonth() : CarbonImmutable
- subMonthNoOverflow() : CarbonImmutable
- subMonths() : CarbonImmutable
- subMonthsNoOverflow() : CarbonImmutable
- subMonthsWithNoOverflow() : CarbonImmutable
- subMonthsWithoutOverflow() : CarbonImmutable
- subMonthsWithOverflow() : CarbonImmutable
- subMonthWithNoOverflow() : CarbonImmutable
- subMonthWithoutOverflow() : CarbonImmutable
- subMonthWithOverflow() : CarbonImmutable
- subQuarter() : CarbonImmutable
- subQuarterNoOverflow() : CarbonImmutable
- subQuarters() : CarbonImmutable
- subQuartersNoOverflow() : CarbonImmutable
- subQuartersWithNoOverflow() : CarbonImmutable
- subQuartersWithoutOverflow() : CarbonImmutable
- subQuartersWithOverflow() : CarbonImmutable
- subQuarterWithNoOverflow() : CarbonImmutable
- subQuarterWithoutOverflow() : CarbonImmutable
- subQuarterWithOverflow() : CarbonImmutable
- subRealCenturies() : CarbonImmutable
- subRealCentury() : CarbonImmutable
- subRealDay() : CarbonImmutable
- subRealDays() : CarbonImmutable
- subRealDecade() : CarbonImmutable
- subRealDecades() : CarbonImmutable
- subRealHour() : CarbonImmutable
- subRealHours() : CarbonImmutable
- subRealMicro() : CarbonImmutable
- subRealMicros() : CarbonImmutable
- subRealMicrosecond() : CarbonImmutable
- subRealMicroseconds() : CarbonImmutable
- subRealMillennia() : CarbonImmutable
- subRealMillennium() : CarbonImmutable
- subRealMilli() : CarbonImmutable
- subRealMillis() : CarbonImmutable
- subRealMillisecond() : CarbonImmutable
- subRealMilliseconds() : CarbonImmutable
- subRealMinute() : CarbonImmutable
- subRealMinutes() : CarbonImmutable
- subRealMonth() : CarbonImmutable
- subRealMonths() : CarbonImmutable
- subRealQuarter() : CarbonImmutable
- subRealQuarters() : CarbonImmutable
- subRealSecond() : CarbonImmutable
- subRealSeconds() : CarbonImmutable
- subRealWeek() : CarbonImmutable
- subRealWeeks() : CarbonImmutable
- subRealYear() : CarbonImmutable
- subRealYears() : CarbonImmutable
- subSecond() : CarbonImmutable
- subSeconds() : CarbonImmutable
- subUnitNoOverflow() : static
- Subtract any unit to a new value without overflowing current other unit given.
- subWeek() : CarbonImmutable
- subWeekday() : CarbonImmutable
- subWeekdays() : CarbonImmutable
- subWeeks() : CarbonImmutable
- subYear() : CarbonImmutable
- subYearNoOverflow() : CarbonImmutable
- subYears() : CarbonImmutable
- subYearsNoOverflow() : CarbonImmutable
- subYearsWithNoOverflow() : CarbonImmutable
- subYearsWithoutOverflow() : CarbonImmutable
- subYearsWithOverflow() : CarbonImmutable
- subYearWithNoOverflow() : CarbonImmutable
- subYearWithoutOverflow() : CarbonImmutable
- subYearWithOverflow() : CarbonImmutable
- timezone() : static
- translatedFormat() : string
- Format as ->format() do (using date replacements patterns from http://php.net/manual/fr/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() : int|static
- 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).
- weeksUntil() : CarbonPeriod
- year() : CarbonImmutable
- years() : CarbonImmutable
- yearsUntil() : CarbonPeriod
- executeCallable() : mixed
- executeCallableWithContext() : mixed
- executeStaticCallable() : mixed
- expectDateTime() : mixed
- Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface.
- getGenericMacros() : mixed
- getRangesByUnit() : array<string|int, mixed>
- List of minimum and maximums for each unit.
- getTranslatedFormByRegExp() : mixed
- resolveCarbon() : static
- 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|false
- Creates a DateTimeZone from a string, DateTimeZone or integer offset.
Properties
$age
public
int
$age
does a diffInYears() with default parameters
$century read-only
public
int
$century
the century of this instance
$day
public
int
$day
$dayName read-only
public
string
$dayName
long name of weekday translated according to Carbon locale, in english if no translation available for current language
$dayOfWeek read-only
public
int
$dayOfWeek
0 (for Sunday) through 6 (for Saturday)
$dayOfWeekIso read-only
public
int
$dayOfWeekIso
1 (for Monday) through 7 (for Sunday)
$dayOfYear
public
int
$dayOfYear
1 through 366
$daysInMonth read-only
public
int
$daysInMonth
number of days in the given month
$daysInYear read-only
public
int
$daysInYear
365 or 366
$decade read-only
public
int
$decade
the decade of this instance
$dst read-only
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 read-only
public
int
$firstWeekDay
0 through 6
$hour
public
int
$hour
$isoWeek
public
int
$isoWeek
1 through 53
$isoWeeksInYear read-only
public
int
$isoWeeksInYear
51 through 53
$isoWeekYear
public
int
$isoWeekYear
year according to ISO week format
$lastWeekDay read-only
public
int
$lastWeekDay
0 through 6
$latinMeridiem read-only
public
string
$latinMeridiem
"am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)
$latinUpperMeridiem read-only
public
string
$latinUpperMeridiem
"AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)
$local read-only
public
bool
$local
checks if the timezone is local, true if local, false otherwise
$locale read-only
public
string
$locale
locale of the current instance
$localeDayOfWeek
public
string
$localeDayOfWeek
the day of week in current locale LC_TIME
$localeMonth
public
string
$localeMonth
the month in current locale LC_TIME
$meridiem read-only
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
$millennium read-only
public
int
$millennium
the millennium of this instance
$milli
public
int
$milli
$millisecond
public
int
$millisecond
$milliseconds
public
int
$milliseconds
$minDayName read-only
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
$month
public
int
$month
$monthName read-only
public
string
$monthName
long name of month translated according to Carbon locale, in english if no translation available for current language
$noZeroHour read-only
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 read-only
public
int
$quarter
the quarter of this instance, 1 - 4
$second
public
int
$second
$shortDayName read-only
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 LC_TIME
$shortLocaleMonth
public
string
$shortLocaleMonth
the abbreviated month in current locale LC_TIME
$shortMonthName read-only
public
string
$shortMonthName
short name of month translated according to Carbon locale, in english if no translation available for current language
$timestamp
public
int
$timestamp
seconds since the Unix Epoch
$timezone
public
CarbonTimeZone
$timezone
the current timezone
$timezoneAbbreviatedName read-only
public
string
$timezoneAbbreviatedName
the current timezone abbreviated name
$timezoneName read-only
public
string
$timezoneName
the current timezone name
$tz
public
CarbonTimeZone
$tz
alias of $timezone
$tzAbbrName read-only
public
string
$tzAbbrName
alias of $timezoneAbbreviatedName
$tzName read-only
public
string
$tzName
alias of $timezoneName
$upperMeridiem read-only
public
string
$upperMeridiem
uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language
$utc read-only
public
bool
$utc
checks if the timezone is UTC, true if UTC, false otherwise
$week
public
int
$week
1 through 53
$weekNumberInMonth read-only
public
int
$weekNumberInMonth
1 through 5
$weekOfMonth read-only
public
int
$weekOfMonth
1 through 5
$weekOfYear read-only
public
int
$weekOfYear
ISO-8601 week number of year, weeks starting on Monday
$weeksInYear read-only
public
int
$weeksInYear
51 through 53
$weekYear
public
int
$weekYear
year according to week format
$year
public
int
$year
$yearIso
public
int
$yearIso
$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',
]
$utf8
Will UTF8 encoding be used to print localized date/time ?
protected
static bool
$utf8
= false
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
Return values
mixed —__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
Return values
mixed —__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
Return values
void —__set_state()
The __set_state handler.
public
static __set_state(array<string|int, mixed> $array) : static
https://php.net/manual/en/datetime.set-state.php
Parameters
- $array : array<string|int, mixed>
Return values
static —addCenturies()
public
addCenturies(int $value = 1) : CarbonImmutable
Add centuries (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addCenturiesNoOverflow()
public
addCenturiesNoOverflow(int $value = 1) : CarbonImmutable
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addCenturiesWithNoOverflow()
public
addCenturiesWithNoOverflow(int $value = 1) : CarbonImmutable
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addCenturiesWithoutOverflow()
public
addCenturiesWithoutOverflow(int $value = 1) : CarbonImmutable
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addCenturiesWithOverflow()
public
addCenturiesWithOverflow(int $value = 1) : CarbonImmutable
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addCentury()
public
addCentury() : CarbonImmutable
Add one century to the instance (using date interval).
Return values
CarbonImmutable —addCenturyNoOverflow()
public
addCenturyNoOverflow() : CarbonImmutable
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addCenturyWithNoOverflow()
public
addCenturyWithNoOverflow() : CarbonImmutable
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addCenturyWithoutOverflow()
public
addCenturyWithoutOverflow() : CarbonImmutable
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addCenturyWithOverflow()
public
addCenturyWithOverflow() : CarbonImmutable
Add one century to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —addDay()
public
addDay() : CarbonImmutable
Add one day to the instance (using date interval).
Return values
CarbonImmutable —addDays()
public
addDays(int $value = 1) : CarbonImmutable
Add days (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addDecade()
public
addDecade() : CarbonImmutable
Add one decade to the instance (using date interval).
Return values
CarbonImmutable —addDecadeNoOverflow()
public
addDecadeNoOverflow() : CarbonImmutable
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addDecades()
public
addDecades(int $value = 1) : CarbonImmutable
Add decades (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addDecadesNoOverflow()
public
addDecadesNoOverflow(int $value = 1) : CarbonImmutable
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addDecadesWithNoOverflow()
public
addDecadesWithNoOverflow(int $value = 1) : CarbonImmutable
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addDecadesWithoutOverflow()
public
addDecadesWithoutOverflow(int $value = 1) : CarbonImmutable
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addDecadesWithOverflow()
public
addDecadesWithOverflow(int $value = 1) : CarbonImmutable
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addDecadeWithNoOverflow()
public
addDecadeWithNoOverflow() : CarbonImmutable
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addDecadeWithoutOverflow()
public
addDecadeWithoutOverflow() : CarbonImmutable
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addDecadeWithOverflow()
public
addDecadeWithOverflow() : CarbonImmutable
Add one decade to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —addHour()
public
addHour() : CarbonImmutable
Add one hour to the instance (using date interval).
Return values
CarbonImmutable —addHours()
public
addHours(int $value = 1) : CarbonImmutable
Add hours (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMicro()
public
addMicro() : CarbonImmutable
Add one microsecond to the instance (using date interval).
Return values
CarbonImmutable —addMicros()
public
addMicros(int $value = 1) : CarbonImmutable
Add microseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMicrosecond()
public
addMicrosecond() : CarbonImmutable
Add one microsecond to the instance (using date interval).
Return values
CarbonImmutable —addMicroseconds()
public
addMicroseconds(int $value = 1) : CarbonImmutable
Add microseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMillennia()
public
addMillennia(int $value = 1) : CarbonImmutable
Add millennia (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMillenniaNoOverflow()
public
addMillenniaNoOverflow(int $value = 1) : CarbonImmutable
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMillenniaWithNoOverflow()
public
addMillenniaWithNoOverflow(int $value = 1) : CarbonImmutable
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMillenniaWithoutOverflow()
public
addMillenniaWithoutOverflow(int $value = 1) : CarbonImmutable
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMillenniaWithOverflow()
public
addMillenniaWithOverflow(int $value = 1) : CarbonImmutable
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMillennium()
public
addMillennium() : CarbonImmutable
Add one millennium to the instance (using date interval).
Return values
CarbonImmutable —addMillenniumNoOverflow()
public
addMillenniumNoOverflow() : CarbonImmutable
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addMillenniumWithNoOverflow()
public
addMillenniumWithNoOverflow() : CarbonImmutable
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addMillenniumWithoutOverflow()
public
addMillenniumWithoutOverflow() : CarbonImmutable
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addMillenniumWithOverflow()
public
addMillenniumWithOverflow() : CarbonImmutable
Add one millennium to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —addMilli()
public
addMilli() : CarbonImmutable
Add one millisecond to the instance (using date interval).
Return values
CarbonImmutable —addMillis()
public
addMillis(int $value = 1) : CarbonImmutable
Add milliseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMillisecond()
public
addMillisecond() : CarbonImmutable
Add one millisecond to the instance (using date interval).
Return values
CarbonImmutable —addMilliseconds()
public
addMilliseconds(int $value = 1) : CarbonImmutable
Add milliseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMinute()
public
addMinute() : CarbonImmutable
Add one minute to the instance (using date interval).
Return values
CarbonImmutable —addMinutes()
public
addMinutes(int $value = 1) : CarbonImmutable
Add minutes (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMonth()
public
addMonth() : CarbonImmutable
Add one month to the instance (using date interval).
Return values
CarbonImmutable —addMonthNoOverflow()
public
addMonthNoOverflow() : CarbonImmutable
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addMonths()
public
addMonths(int $value = 1) : CarbonImmutable
Add months (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMonthsNoOverflow()
public
addMonthsNoOverflow(int $value = 1) : CarbonImmutable
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMonthsWithNoOverflow()
public
addMonthsWithNoOverflow(int $value = 1) : CarbonImmutable
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMonthsWithoutOverflow()
public
addMonthsWithoutOverflow(int $value = 1) : CarbonImmutable
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMonthsWithOverflow()
public
addMonthsWithOverflow(int $value = 1) : CarbonImmutable
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addMonthWithNoOverflow()
public
addMonthWithNoOverflow() : CarbonImmutable
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addMonthWithoutOverflow()
public
addMonthWithoutOverflow() : CarbonImmutable
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addMonthWithOverflow()
public
addMonthWithOverflow() : CarbonImmutable
Add one month to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —addQuarter()
public
addQuarter() : CarbonImmutable
Add one quarter to the instance (using date interval).
Return values
CarbonImmutable —addQuarterNoOverflow()
public
addQuarterNoOverflow() : CarbonImmutable
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addQuarters()
public
addQuarters(int $value = 1) : CarbonImmutable
Add quarters (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addQuartersNoOverflow()
public
addQuartersNoOverflow(int $value = 1) : CarbonImmutable
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addQuartersWithNoOverflow()
public
addQuartersWithNoOverflow(int $value = 1) : CarbonImmutable
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addQuartersWithoutOverflow()
public
addQuartersWithoutOverflow(int $value = 1) : CarbonImmutable
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addQuartersWithOverflow()
public
addQuartersWithOverflow(int $value = 1) : CarbonImmutable
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addQuarterWithNoOverflow()
public
addQuarterWithNoOverflow() : CarbonImmutable
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addQuarterWithoutOverflow()
public
addQuarterWithoutOverflow() : CarbonImmutable
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addQuarterWithOverflow()
public
addQuarterWithOverflow() : CarbonImmutable
Add one quarter to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —addRealCenturies()
public
addRealCenturies(int $value = 1) : CarbonImmutable
Add centuries (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealCentury()
public
addRealCentury() : CarbonImmutable
Add one century to the instance (using timestamp).
Return values
CarbonImmutable —addRealDay()
public
addRealDay() : CarbonImmutable
Add one day to the instance (using timestamp).
Return values
CarbonImmutable —addRealDays()
public
addRealDays(int $value = 1) : CarbonImmutable
Add days (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealDecade()
public
addRealDecade() : CarbonImmutable
Add one decade to the instance (using timestamp).
Return values
CarbonImmutable —addRealDecades()
public
addRealDecades(int $value = 1) : CarbonImmutable
Add decades (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealHour()
public
addRealHour() : CarbonImmutable
Add one hour to the instance (using timestamp).
Return values
CarbonImmutable —addRealHours()
public
addRealHours(int $value = 1) : CarbonImmutable
Add hours (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealMicro()
public
addRealMicro() : CarbonImmutable
Add one microsecond to the instance (using timestamp).
Return values
CarbonImmutable —addRealMicros()
public
addRealMicros(int $value = 1) : CarbonImmutable
Add microseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealMicrosecond()
public
addRealMicrosecond() : CarbonImmutable
Add one microsecond to the instance (using timestamp).
Return values
CarbonImmutable —addRealMicroseconds()
public
addRealMicroseconds(int $value = 1) : CarbonImmutable
Add microseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealMillennia()
public
addRealMillennia(int $value = 1) : CarbonImmutable
Add millennia (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealMillennium()
public
addRealMillennium() : CarbonImmutable
Add one millennium to the instance (using timestamp).
Return values
CarbonImmutable —addRealMilli()
public
addRealMilli() : CarbonImmutable
Add one millisecond to the instance (using timestamp).
Return values
CarbonImmutable —addRealMillis()
public
addRealMillis(int $value = 1) : CarbonImmutable
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealMillisecond()
public
addRealMillisecond() : CarbonImmutable
Add one millisecond to the instance (using timestamp).
Return values
CarbonImmutable —addRealMilliseconds()
public
addRealMilliseconds(int $value = 1) : CarbonImmutable
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealMinute()
public
addRealMinute() : CarbonImmutable
Add one minute to the instance (using timestamp).
Return values
CarbonImmutable —addRealMinutes()
public
addRealMinutes(int $value = 1) : CarbonImmutable
Add minutes (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealMonth()
public
addRealMonth() : CarbonImmutable
Add one month to the instance (using timestamp).
Return values
CarbonImmutable —addRealMonths()
public
addRealMonths(int $value = 1) : CarbonImmutable
Add months (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealQuarter()
public
addRealQuarter() : CarbonImmutable
Add one quarter to the instance (using timestamp).
Return values
CarbonImmutable —addRealQuarters()
public
addRealQuarters(int $value = 1) : CarbonImmutable
Add quarters (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealSecond()
public
addRealSecond() : CarbonImmutable
Add one second to the instance (using timestamp).
Return values
CarbonImmutable —addRealSeconds()
public
addRealSeconds(int $value = 1) : CarbonImmutable
Add seconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealWeek()
public
addRealWeek() : CarbonImmutable
Add one week to the instance (using timestamp).
Return values
CarbonImmutable —addRealWeeks()
public
addRealWeeks(int $value = 1) : CarbonImmutable
Add weeks (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addRealYear()
public
addRealYear() : CarbonImmutable
Add one year to the instance (using timestamp).
Return values
CarbonImmutable —addRealYears()
public
addRealYears(int $value = 1) : CarbonImmutable
Add years (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addSecond()
public
addSecond() : CarbonImmutable
Add one second to the instance (using date interval).
Return values
CarbonImmutable —addSeconds()
public
addSeconds(int $value = 1) : CarbonImmutable
Add seconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addUnitNoOverflow()
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
static —addWeek()
public
addWeek() : CarbonImmutable
Add one week to the instance (using date interval).
Return values
CarbonImmutable —addWeekday()
public
addWeekday() : CarbonImmutable
Add one weekday to the instance (using date interval).
Return values
CarbonImmutable —addWeekdays()
public
addWeekdays(int $value = 1) : CarbonImmutable
Add weekdays (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addWeeks()
public
addWeeks(int $value = 1) : CarbonImmutable
Add weeks (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addYear()
public
addYear() : CarbonImmutable
Add one year to the instance (using date interval).
Return values
CarbonImmutable —addYearNoOverflow()
public
addYearNoOverflow() : CarbonImmutable
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addYears()
public
addYears(int $value = 1) : CarbonImmutable
Add years (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addYearsNoOverflow()
public
addYearsNoOverflow(int $value = 1) : CarbonImmutable
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addYearsWithNoOverflow()
public
addYearsWithNoOverflow(int $value = 1) : CarbonImmutable
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addYearsWithoutOverflow()
public
addYearsWithoutOverflow(int $value = 1) : CarbonImmutable
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addYearsWithOverflow()
public
addYearsWithOverflow(int $value = 1) : CarbonImmutable
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —addYearWithNoOverflow()
public
addYearWithNoOverflow() : CarbonImmutable
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addYearWithoutOverflow()
public
addYearWithoutOverflow() : CarbonImmutable
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —addYearWithOverflow()
public
addYearWithOverflow() : CarbonImmutable
Add one year to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —carbonize()
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
static —ceilCenturies()
public
ceilCenturies(float $precision = 1) : CarbonImmutable
Ceil the current instance century with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilCentury()
public
ceilCentury(float $precision = 1) : CarbonImmutable
Ceil the current instance century with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilDay()
public
ceilDay(float $precision = 1) : CarbonImmutable
Ceil the current instance day with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilDays()
public
ceilDays(float $precision = 1) : CarbonImmutable
Ceil the current instance day with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilDecade()
public
ceilDecade(float $precision = 1) : CarbonImmutable
Ceil the current instance decade with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilDecades()
public
ceilDecades(float $precision = 1) : CarbonImmutable
Ceil the current instance decade with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilHour()
public
ceilHour(float $precision = 1) : CarbonImmutable
Ceil the current instance hour with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilHours()
public
ceilHours(float $precision = 1) : CarbonImmutable
Ceil the current instance hour with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMicrosecond()
public
ceilMicrosecond(float $precision = 1) : CarbonImmutable
Ceil the current instance microsecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMicroseconds()
public
ceilMicroseconds(float $precision = 1) : CarbonImmutable
Ceil the current instance microsecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMillennia()
public
ceilMillennia(float $precision = 1) : CarbonImmutable
Ceil the current instance millennium with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMillennium()
public
ceilMillennium(float $precision = 1) : CarbonImmutable
Ceil the current instance millennium with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMillisecond()
public
ceilMillisecond(float $precision = 1) : CarbonImmutable
Ceil the current instance millisecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMilliseconds()
public
ceilMilliseconds(float $precision = 1) : CarbonImmutable
Ceil the current instance millisecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMinute()
public
ceilMinute(float $precision = 1) : CarbonImmutable
Ceil the current instance minute with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMinutes()
public
ceilMinutes(float $precision = 1) : CarbonImmutable
Ceil the current instance minute with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMonth()
public
ceilMonth(float $precision = 1) : CarbonImmutable
Ceil the current instance month with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilMonths()
public
ceilMonths(float $precision = 1) : CarbonImmutable
Ceil the current instance month with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilQuarter()
public
ceilQuarter(float $precision = 1) : CarbonImmutable
Ceil the current instance quarter with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilQuarters()
public
ceilQuarters(float $precision = 1) : CarbonImmutable
Ceil the current instance quarter with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilSecond()
public
ceilSecond(float $precision = 1) : CarbonImmutable
Ceil the current instance second with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilSeconds()
public
ceilSeconds(float $precision = 1) : CarbonImmutable
Ceil the current instance second with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilYear()
public
ceilYear(float $precision = 1) : CarbonImmutable
Ceil the current instance year with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —ceilYears()
public
ceilYears(float $precision = 1) : CarbonImmutable
Ceil the current instance year with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —centuriesUntil()
public
centuriesUntil(mixed $endDate, int $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
Return values
CarbonPeriod —clone()
public
clone() : static
Tags
Return values
static —copy()
Get a copy of the instance.
public
copy() : static
Return values
static —createFromFormat()
Create a Carbon instance from a specific format.
public
static createFromFormat(string $format, string $time, string|DateTimeZone $timezone = null) : static|false
Parse a string into a new CarbonImmutable object according to the specified format.
Parameters
- $format : string
-
Datetime format
- $time : string
- $timezone = null : string|DateTimeZone
Return values
static|false —createFromMutable()
public
static createFromMutable(DateTime $dateTime) : CarbonImmutable
Create a new CarbonImmutable object from an immutable date.
Parameters
- $dateTime : DateTime
Return values
CarbonImmutable —day()
public
day(int $value) : CarbonImmutable
Set current instance day to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —dayOfYear()
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.
Return values
static|int —days()
public
days(int $value) : CarbonImmutable
Set current instance day to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —daysUntil()
public
daysUntil(mixed $endDate, int $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
Return values
CarbonPeriod —decadesUntil()
public
decadesUntil(mixed $endDate, int $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
Return values
CarbonPeriod —floorCenturies()
public
floorCenturies(float $precision = 1) : CarbonImmutable
Truncate the current instance century with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorCentury()
public
floorCentury(float $precision = 1) : CarbonImmutable
Truncate the current instance century with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorDay()
public
floorDay(float $precision = 1) : CarbonImmutable
Truncate the current instance day with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorDays()
public
floorDays(float $precision = 1) : CarbonImmutable
Truncate the current instance day with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorDecade()
public
floorDecade(float $precision = 1) : CarbonImmutable
Truncate the current instance decade with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorDecades()
public
floorDecades(float $precision = 1) : CarbonImmutable
Truncate the current instance decade with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorHour()
public
floorHour(float $precision = 1) : CarbonImmutable
Truncate the current instance hour with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorHours()
public
floorHours(float $precision = 1) : CarbonImmutable
Truncate the current instance hour with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMicrosecond()
public
floorMicrosecond(float $precision = 1) : CarbonImmutable
Truncate the current instance microsecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMicroseconds()
public
floorMicroseconds(float $precision = 1) : CarbonImmutable
Truncate the current instance microsecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMillennia()
public
floorMillennia(float $precision = 1) : CarbonImmutable
Truncate the current instance millennium with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMillennium()
public
floorMillennium(float $precision = 1) : CarbonImmutable
Truncate the current instance millennium with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMillisecond()
public
floorMillisecond(float $precision = 1) : CarbonImmutable
Truncate the current instance millisecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMilliseconds()
public
floorMilliseconds(float $precision = 1) : CarbonImmutable
Truncate the current instance millisecond with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMinute()
public
floorMinute(float $precision = 1) : CarbonImmutable
Truncate the current instance minute with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMinutes()
public
floorMinutes(float $precision = 1) : CarbonImmutable
Truncate the current instance minute with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMonth()
public
floorMonth(float $precision = 1) : CarbonImmutable
Truncate the current instance month with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorMonths()
public
floorMonths(float $precision = 1) : CarbonImmutable
Truncate the current instance month with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorQuarter()
public
floorQuarter(float $precision = 1) : CarbonImmutable
Truncate the current instance quarter with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorQuarters()
public
floorQuarters(float $precision = 1) : CarbonImmutable
Truncate the current instance quarter with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorSecond()
public
floorSecond(float $precision = 1) : CarbonImmutable
Truncate the current instance second with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorSeconds()
public
floorSeconds(float $precision = 1) : CarbonImmutable
Truncate the current instance second with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorYear()
public
floorYear(float $precision = 1) : CarbonImmutable
Truncate the current instance year with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —floorYears()
public
floorYears(float $precision = 1) : CarbonImmutable
Truncate the current instance year with given precision.
Parameters
- $precision = 1 : float
Return values
CarbonImmutable —formatLocalized()
Format the instance with the current locale. You can set the current locale using setlocale() http://php.net/setlocale.
public
formatLocalized(string $format) : string
Parameters
- $format : string
Return values
string —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 —getAltNumber()
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
string —getCalendarFormats()
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> —getFormatsToIsoReplacements()
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
string —getPaddedUnit()
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
string —getTimezone()
Get the TimeZone associated with the Carbon instance (as CarbonTimeZone).
public
getTimezone() : CarbonTimeZone
Tags
Return values
CarbonTimeZone —getTranslatedDayName()
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
string —getTranslatedMinDayName()
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
string —getTranslatedMonthName()
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
string —getTranslatedShortDayName()
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
string —getTranslatedShortMonthName()
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
string —getWeekendDays()
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() : int
Return values
int —getWeekStartsAt()
Get the first day of week
public
static getWeekStartsAt() : int
Return values
int —hasRelativeKeywords()
Determine if a time string will produce a relative date.
public
static hasRelativeKeywords(string $time) : bool
Parameters
- $time : string
Return values
bool —true if time match a relative date, false if absolute or invalid time string
hour()
public
hour(int $value) : CarbonImmutable
Set current instance hour to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —hours()
public
hours(int $value) : CarbonImmutable
Set current instance hour to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —hoursUntil()
public
hoursUntil(mixed $endDate, int $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
Return values
CarbonPeriod —isCurrentCentury()
public
isCurrentCentury() : bool
Checks if the instance is in the same century as the current moment.
Return values
bool —isCurrentDay()
public
isCurrentDay() : bool
Checks if the instance is in the same day as the current moment.
Return values
bool —isCurrentDecade()
public
isCurrentDecade() : bool
Checks if the instance is in the same decade as the current moment.
Return values
bool —isCurrentHour()
public
isCurrentHour() : bool
Checks if the instance is in the same hour as the current moment.
Return values
bool —isCurrentMicro()
public
isCurrentMicro() : bool
Checks if the instance is in the same microsecond as the current moment.
Return values
bool —isCurrentMicrosecond()
public
isCurrentMicrosecond() : bool
Checks if the instance is in the same microsecond as the current moment.
Return values
bool —isCurrentMillennium()
public
isCurrentMillennium() : bool
Checks if the instance is in the same millennium as the current moment.
Return values
bool —isCurrentMinute()
public
isCurrentMinute() : bool
Checks if the instance is in the same minute as the current moment.
Return values
bool —isCurrentMonth()
public
isCurrentMonth() : bool
Checks if the instance is in the same month as the current moment.
Return values
bool —isCurrentQuarter()
public
isCurrentQuarter() : bool
Checks if the instance is in the same quarter as the current moment.
Return values
bool —isCurrentSecond()
public
isCurrentSecond() : bool
Checks if the instance is in the same second as the current moment.
Return values
bool —isCurrentWeek()
public
isCurrentWeek() : bool
Checks if the instance is in the same week as the current moment.
Return values
bool —isCurrentYear()
public
isCurrentYear() : bool
Checks if the instance is in the same year as the current moment.
Return values
bool —isDST()
public
isDST() : bool
Check if the current instance is in a daylight saving time.
Return values
bool —isFriday()
public
isFriday() : bool
Checks if the instance day is friday.
Return values
bool —isLastCentury()
public
isLastCentury() : bool
Checks if the instance is in the same century as the current moment last century.
Return values
bool —isLastDay()
public
isLastDay() : bool
Checks if the instance is in the same day as the current moment last day.
Return values
bool —isLastDecade()
public
isLastDecade() : bool
Checks if the instance is in the same decade as the current moment last decade.
Return values
bool —isLastHour()
public
isLastHour() : bool
Checks if the instance is in the same hour as the current moment last hour.
Return values
bool —isLastMicro()
public
isLastMicro() : bool
Checks if the instance is in the same microsecond as the current moment last microsecond.
Return values
bool —isLastMicrosecond()
public
isLastMicrosecond() : bool
Checks if the instance is in the same microsecond as the current moment last microsecond.
Return values
bool —isLastMillennium()
public
isLastMillennium() : bool
Checks if the instance is in the same millennium as the current moment last millennium.
Return values
bool —isLastMinute()
public
isLastMinute() : bool
Checks if the instance is in the same minute as the current moment last minute.
Return values
bool —isLastMonth()
public
isLastMonth() : bool
Checks if the instance is in the same month as the current moment last month.
Return values
bool —isLastQuarter()
public
isLastQuarter() : bool
Checks if the instance is in the same quarter as the current moment last quarter.
Return values
bool —isLastSecond()
public
isLastSecond() : bool
Checks if the instance is in the same second as the current moment last second.
Return values
bool —isLastWeek()
public
isLastWeek() : bool
Checks if the instance is in the same week as the current moment last week.
Return values
bool —isLastYear()
public
isLastYear() : bool
Checks if the instance is in the same year as the current moment last year.
Return values
bool —isLocal()
public
isLocal() : bool
Check if the current instance has non-UTC timezone.
Return values
bool —isMonday()
public
isMonday() : bool
Checks if the instance day is monday.
Return values
bool —isNextCentury()
public
isNextCentury() : bool
Checks if the instance is in the same century as the current moment next century.
Return values
bool —isNextDay()
public
isNextDay() : bool
Checks if the instance is in the same day as the current moment next day.
Return values
bool —isNextDecade()
public
isNextDecade() : bool
Checks if the instance is in the same decade as the current moment next decade.
Return values
bool —isNextHour()
public
isNextHour() : bool
Checks if the instance is in the same hour as the current moment next hour.
Return values
bool —isNextMicro()
public
isNextMicro() : bool
Checks if the instance is in the same microsecond as the current moment next microsecond.
Return values
bool —isNextMicrosecond()
public
isNextMicrosecond() : bool
Checks if the instance is in the same microsecond as the current moment next microsecond.
Return values
bool —isNextMillennium()
public
isNextMillennium() : bool
Checks if the instance is in the same millennium as the current moment next millennium.
Return values
bool —isNextMinute()
public
isNextMinute() : bool
Checks if the instance is in the same minute as the current moment next minute.
Return values
bool —isNextMonth()
public
isNextMonth() : bool
Checks if the instance is in the same month as the current moment next month.
Return values
bool —isNextQuarter()
public
isNextQuarter() : bool
Checks if the instance is in the same quarter as the current moment next quarter.
Return values
bool —isNextSecond()
public
isNextSecond() : bool
Checks if the instance is in the same second as the current moment next second.
Return values
bool —isNextWeek()
public
isNextWeek() : bool
Checks if the instance is in the same week as the current moment next week.
Return values
bool —isNextYear()
public
isNextYear() : bool
Checks if the instance is in the same year as the current moment next year.
Return values
bool —isoFormat()
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
string —isoWeekday()
Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
public
isoWeekday([int|null $value = null ]) : static|int
Parameters
- $value : int|null = null
-
new value for weekday if using as setter.
Return values
static|int —isSameCentury()
public
isSameCentury(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameDay()
public
isSameDay(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameDecade()
public
isSameDecade(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameHour()
public
isSameHour(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameMicro()
public
isSameMicro(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameMicrosecond()
public
isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameMillennium()
public
isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameMinute()
public
isSameMinute(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameSecond()
public
isSameSecond(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameWeek()
public
isSameWeek(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSameYear()
public
isSameYear(Carbon|DateTimeInterface|string|null $date = null) : 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 = null : Carbon|DateTimeInterface|string|null
Return values
bool —isSaturday()
public
isSaturday() : bool
Checks if the instance day is saturday.
Return values
bool —isSunday()
public
isSunday() : bool
Checks if the instance day is sunday.
Return values
bool —isThursday()
public
isThursday() : bool
Checks if the instance day is thursday.
Return values
bool —isTuesday()
public
isTuesday() : bool
Checks if the instance day is tuesday.
Return values
bool —isUtc()
public
isUtc() : bool
Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
Return values
bool —isValid()
public
isValid() : bool
Check if the current instance is a valid date.
Return values
bool —isWednesday()
public
isWednesday() : bool
Checks if the instance day is wednesday.
Return values
bool —longAbsoluteDiffForHumans()
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
string —longRelativeDiffForHumans()
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
string —longRelativeToNowDiffForHumans()
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
string —longRelativeToOtherDiffForHumans()
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
string —meridiem()
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
string —micro()
public
micro(int $value) : CarbonImmutable
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —micros()
public
micros(int $value) : CarbonImmutable
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —microsecond()
public
microsecond(int $value) : CarbonImmutable
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —microseconds()
public
microseconds(int $value) : CarbonImmutable
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —microsecondsUntil()
public
microsecondsUntil(mixed $endDate, int $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
Return values
CarbonPeriod —microsUntil()
public
microsUntil(mixed $endDate, int $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
Return values
CarbonPeriod —millenniaUntil()
public
millenniaUntil(mixed $endDate, int $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
Return values
CarbonPeriod —milli()
public
milli(int $value) : CarbonImmutable
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —millis()
public
millis(int $value) : CarbonImmutable
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —millisecond()
public
millisecond(int $value) : CarbonImmutable
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —milliseconds()
public
milliseconds(int $value) : CarbonImmutable
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —millisecondsUntil()
public
millisecondsUntil(mixed $endDate, int $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
Return values
CarbonPeriod —millisUntil()
public
millisUntil(mixed $endDate, int $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
Return values
CarbonPeriod —minute()
public
minute(int $value) : CarbonImmutable
Set current instance minute to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —minutes()
public
minutes(int $value) : CarbonImmutable
Set current instance minute to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —minutesUntil()
public
minutesUntil(mixed $endDate, int $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
Return values
CarbonPeriod —month()
public
month(int $value) : CarbonImmutable
Set current instance month to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —months()
public
months(int $value) : CarbonImmutable
Set current instance month to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —monthsUntil()
public
monthsUntil(mixed $endDate, int $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
Return values
CarbonPeriod —nowWithSameTz()
Returns a present instance in the same timezone.
public
nowWithSameTz() : static
Return values
static —ordinal()
Return a property with its ordinal.
public
ordinal(string $key[, string|null $period = null ]) : string
Parameters
- $key : string
- $period : string|null = null
Return values
string —pluralUnit()
Returns standardized plural of a given singular/plural unit name (in English).
public
static pluralUnit(string $unit) : string
Parameters
- $unit : string
Return values
string —quartersUntil()
public
quartersUntil(mixed $endDate, int $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
Return values
CarbonPeriod —roundCenturies()
public
roundCenturies(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance century with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundCentury()
public
roundCentury(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance century with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundDay()
public
roundDay(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance day with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundDays()
public
roundDays(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance day with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundDecade()
public
roundDecade(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance decade with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundDecades()
public
roundDecades(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance decade with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundHour()
public
roundHour(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance hour with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundHours()
public
roundHours(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance hour with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMicrosecond()
public
roundMicrosecond(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance microsecond with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMicroseconds()
public
roundMicroseconds(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance microsecond with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMillennia()
public
roundMillennia(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance millennium with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMillennium()
public
roundMillennium(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance millennium with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMillisecond()
public
roundMillisecond(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance millisecond with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMilliseconds()
public
roundMilliseconds(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance millisecond with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMinute()
public
roundMinute(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance minute with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMinutes()
public
roundMinutes(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance minute with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMonth()
public
roundMonth(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance month with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundMonths()
public
roundMonths(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance month with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundQuarter()
public
roundQuarter(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance quarter with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundQuarters()
public
roundQuarters(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance quarter with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundSecond()
public
roundSecond(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance second with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundSeconds()
public
roundSeconds(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance second with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundYear()
public
roundYear(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance year with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —roundYears()
public
roundYears(float $precision = 1, string $function = "round") : CarbonImmutable
Round the current instance year with given precision using the given function.
Parameters
- $precision = 1 : float
- $function = "round" : string
Return values
CarbonImmutable —second()
public
second(int $value) : CarbonImmutable
Set current instance second to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —seconds()
public
seconds(int $value) : CarbonImmutable
Set current instance second to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —secondsUntil()
public
secondsUntil(mixed $endDate, int $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
Return values
CarbonPeriod —set()
Set a part of the Carbon object
public
set(string|array<string|int, mixed> $name[, string|int|DateTimeZone $value = null ]) : $this
Parameters
- $name : string|array<string|int, mixed>
- $value : string|int|DateTimeZone = null
Tags
Return values
$this —setDate()
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
static —setDateFrom()
Set the year, month, and date for this instance to that of the passed instance.
public
setDateFrom([Carbon|DateTimeInterface $date = null ]) : static
Parameters
- $date : Carbon|DateTimeInterface = null
-
now if null
Return values
static —setDateTime()
Set the date and time all together.
public
setDateTime(int $year, int $month, int $day, int $hour, int $minute, int $second, int $microseconds) : static
Parameters
- $year : int
- $month : int
- $day : int
- $hour : int
- $minute : int
- $second : int
- $microseconds : int
Return values
static —setDateTimeFrom()
Set the date and time for this instance to that of the passed instance.
public
setDateTimeFrom([Carbon|DateTimeInterface $date = null ]) : static
Parameters
- $date : Carbon|DateTimeInterface = null
Return values
static —setDay()
public
setDay(int $value) : CarbonImmutable
Set current instance day to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setDays()
public
setDays(int $value) : CarbonImmutable
Set current instance day to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setHour()
public
setHour(int $value) : CarbonImmutable
Set current instance hour to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setHours()
public
setHours(int $value) : CarbonImmutable
Set current instance hour to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setISODate()
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
static —setMicro()
public
setMicro(int $value) : CarbonImmutable
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMicros()
public
setMicros(int $value) : CarbonImmutable
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMicrosecond()
public
setMicrosecond(int $value) : CarbonImmutable
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMicroseconds()
public
setMicroseconds(int $value) : CarbonImmutable
Set current instance microsecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMilli()
public
setMilli(int $value) : CarbonImmutable
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMillis()
public
setMillis(int $value) : CarbonImmutable
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMillisecond()
public
setMillisecond(int $value) : CarbonImmutable
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMilliseconds()
public
setMilliseconds(int $value) : CarbonImmutable
Set current instance millisecond to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMinute()
public
setMinute(int $value) : CarbonImmutable
Set current instance minute to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMinutes()
public
setMinutes(int $value) : CarbonImmutable
Set current instance minute to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMonth()
public
setMonth(int $value) : CarbonImmutable
Set current instance month to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setMonths()
public
setMonths(int $value) : CarbonImmutable
Set current instance month to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setSecond()
public
setSecond(int $value) : CarbonImmutable
Set current instance second to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setSeconds()
public
setSeconds(int $value) : CarbonImmutable
Set current instance second to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setTime()
Resets the current time of the DateTime object to a different time.
public
setTime(int $hour, int $minute, int $second, int $microseconds) : static
Parameters
- $hour : int
- $minute : int
- $second : int
- $microseconds : int
Tags
Return values
static —setTimeFrom()
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
public
setTimeFrom([Carbon|DateTimeInterface $date = null ]) : static
Parameters
- $date : Carbon|DateTimeInterface = null
-
now if null
Return values
static —setTimeFromTimeString()
Set the time by time string.
public
setTimeFromTimeString(string $time) : static
Parameters
- $time : string
Return values
static —setTimestamp()
Sets the date and time based on an Unix timestamp.
public
setTimestamp(int $unixtimestamp) : static
Parameters
- $unixtimestamp : int
Tags
Return values
static —setTimezone()
Set the instance's timezone from a string or object.
public
setTimezone(DateTimeZone|string $value) : static
Parameters
- $value : DateTimeZone|string
Return values
static —setUnit()
Set specified unit to new given value.
public
setUnit(string $unit[, int $value = null ]) : static
Parameters
- $unit : string
-
year, month, day, hour, minute, second or microsecond
- $value : int = null
-
new value for given unit
Return values
static —setUnitNoOverflow()
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
static —setUtf8()
public
static setUtf8(bool $utf8) : mixed
Parameters
- $utf8 : bool
Tags
Return values
mixed —setWeekendDays()
public
static setWeekendDays(array<string|int, mixed> $days) : void
Parameters
- $days : array<string|int, mixed>
Tags
Return values
void —setWeekEndsAt()
public
static setWeekEndsAt(int $day) : void
Parameters
- $day : int
Tags
Return values
void —setWeekStartsAt()
public
static setWeekStartsAt(int $day) : void
Parameters
- $day : int
-
week start day
Tags
Return values
void —setYear()
public
setYear(int $value) : CarbonImmutable
Set current instance year to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —setYears()
public
setYears(int $value) : CarbonImmutable
Set current instance year to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —shiftTimezone()
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
static —shortAbsoluteDiffForHumans()
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
string —shortRelativeDiffForHumans()
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
string —shortRelativeToNowDiffForHumans()
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
string —shortRelativeToOtherDiffForHumans()
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
string —singularUnit()
Returns standardized singular of a given singular/plural unit name (in English).
public
static singularUnit(string $unit) : string
Parameters
- $unit : string
Return values
string —subCenturies()
public
subCenturies(int $value = 1) : CarbonImmutable
Sub centuries (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subCenturiesNoOverflow()
public
subCenturiesNoOverflow(int $value = 1) : CarbonImmutable
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subCenturiesWithNoOverflow()
public
subCenturiesWithNoOverflow(int $value = 1) : CarbonImmutable
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subCenturiesWithoutOverflow()
public
subCenturiesWithoutOverflow(int $value = 1) : CarbonImmutable
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subCenturiesWithOverflow()
public
subCenturiesWithOverflow(int $value = 1) : CarbonImmutable
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subCentury()
public
subCentury() : CarbonImmutable
Sub one century to the instance (using date interval).
Return values
CarbonImmutable —subCenturyNoOverflow()
public
subCenturyNoOverflow() : CarbonImmutable
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subCenturyWithNoOverflow()
public
subCenturyWithNoOverflow() : CarbonImmutable
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subCenturyWithoutOverflow()
public
subCenturyWithoutOverflow() : CarbonImmutable
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subCenturyWithOverflow()
public
subCenturyWithOverflow() : CarbonImmutable
Sub one century to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —subDay()
public
subDay() : CarbonImmutable
Sub one day to the instance (using date interval).
Return values
CarbonImmutable —subDays()
public
subDays(int $value = 1) : CarbonImmutable
Sub days (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subDecade()
public
subDecade() : CarbonImmutable
Sub one decade to the instance (using date interval).
Return values
CarbonImmutable —subDecadeNoOverflow()
public
subDecadeNoOverflow() : CarbonImmutable
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subDecades()
public
subDecades(int $value = 1) : CarbonImmutable
Sub decades (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subDecadesNoOverflow()
public
subDecadesNoOverflow(int $value = 1) : CarbonImmutable
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subDecadesWithNoOverflow()
public
subDecadesWithNoOverflow(int $value = 1) : CarbonImmutable
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subDecadesWithoutOverflow()
public
subDecadesWithoutOverflow(int $value = 1) : CarbonImmutable
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subDecadesWithOverflow()
public
subDecadesWithOverflow(int $value = 1) : CarbonImmutable
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subDecadeWithNoOverflow()
public
subDecadeWithNoOverflow() : CarbonImmutable
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subDecadeWithoutOverflow()
public
subDecadeWithoutOverflow() : CarbonImmutable
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subDecadeWithOverflow()
public
subDecadeWithOverflow() : CarbonImmutable
Sub one decade to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —subHour()
public
subHour() : CarbonImmutable
Sub one hour to the instance (using date interval).
Return values
CarbonImmutable —subHours()
public
subHours(int $value = 1) : CarbonImmutable
Sub hours (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMicro()
public
subMicro() : CarbonImmutable
Sub one microsecond to the instance (using date interval).
Return values
CarbonImmutable —subMicros()
public
subMicros(int $value = 1) : CarbonImmutable
Sub microseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMicrosecond()
public
subMicrosecond() : CarbonImmutable
Sub one microsecond to the instance (using date interval).
Return values
CarbonImmutable —subMicroseconds()
public
subMicroseconds(int $value = 1) : CarbonImmutable
Sub microseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMillennia()
public
subMillennia(int $value = 1) : CarbonImmutable
Sub millennia (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMillenniaNoOverflow()
public
subMillenniaNoOverflow(int $value = 1) : CarbonImmutable
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMillenniaWithNoOverflow()
public
subMillenniaWithNoOverflow(int $value = 1) : CarbonImmutable
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMillenniaWithoutOverflow()
public
subMillenniaWithoutOverflow(int $value = 1) : CarbonImmutable
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMillenniaWithOverflow()
public
subMillenniaWithOverflow(int $value = 1) : CarbonImmutable
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMillennium()
public
subMillennium() : CarbonImmutable
Sub one millennium to the instance (using date interval).
Return values
CarbonImmutable —subMillenniumNoOverflow()
public
subMillenniumNoOverflow() : CarbonImmutable
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subMillenniumWithNoOverflow()
public
subMillenniumWithNoOverflow() : CarbonImmutable
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subMillenniumWithoutOverflow()
public
subMillenniumWithoutOverflow() : CarbonImmutable
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subMillenniumWithOverflow()
public
subMillenniumWithOverflow() : CarbonImmutable
Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —subMilli()
public
subMilli() : CarbonImmutable
Sub one millisecond to the instance (using date interval).
Return values
CarbonImmutable —subMillis()
public
subMillis(int $value = 1) : CarbonImmutable
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMillisecond()
public
subMillisecond() : CarbonImmutable
Sub one millisecond to the instance (using date interval).
Return values
CarbonImmutable —subMilliseconds()
public
subMilliseconds(int $value = 1) : CarbonImmutable
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMinute()
public
subMinute() : CarbonImmutable
Sub one minute to the instance (using date interval).
Return values
CarbonImmutable —subMinutes()
public
subMinutes(int $value = 1) : CarbonImmutable
Sub minutes (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMonth()
public
subMonth() : CarbonImmutable
Sub one month to the instance (using date interval).
Return values
CarbonImmutable —subMonthNoOverflow()
public
subMonthNoOverflow() : CarbonImmutable
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subMonths()
public
subMonths(int $value = 1) : CarbonImmutable
Sub months (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMonthsNoOverflow()
public
subMonthsNoOverflow(int $value = 1) : CarbonImmutable
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMonthsWithNoOverflow()
public
subMonthsWithNoOverflow(int $value = 1) : CarbonImmutable
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMonthsWithoutOverflow()
public
subMonthsWithoutOverflow(int $value = 1) : CarbonImmutable
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMonthsWithOverflow()
public
subMonthsWithOverflow(int $value = 1) : CarbonImmutable
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subMonthWithNoOverflow()
public
subMonthWithNoOverflow() : CarbonImmutable
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subMonthWithoutOverflow()
public
subMonthWithoutOverflow() : CarbonImmutable
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subMonthWithOverflow()
public
subMonthWithOverflow() : CarbonImmutable
Sub one month to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —subQuarter()
public
subQuarter() : CarbonImmutable
Sub one quarter to the instance (using date interval).
Return values
CarbonImmutable —subQuarterNoOverflow()
public
subQuarterNoOverflow() : CarbonImmutable
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subQuarters()
public
subQuarters(int $value = 1) : CarbonImmutable
Sub quarters (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subQuartersNoOverflow()
public
subQuartersNoOverflow(int $value = 1) : CarbonImmutable
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subQuartersWithNoOverflow()
public
subQuartersWithNoOverflow(int $value = 1) : CarbonImmutable
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subQuartersWithoutOverflow()
public
subQuartersWithoutOverflow(int $value = 1) : CarbonImmutable
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subQuartersWithOverflow()
public
subQuartersWithOverflow(int $value = 1) : CarbonImmutable
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subQuarterWithNoOverflow()
public
subQuarterWithNoOverflow() : CarbonImmutable
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subQuarterWithoutOverflow()
public
subQuarterWithoutOverflow() : CarbonImmutable
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subQuarterWithOverflow()
public
subQuarterWithOverflow() : CarbonImmutable
Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —subRealCenturies()
public
subRealCenturies(int $value = 1) : CarbonImmutable
Sub centuries (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealCentury()
public
subRealCentury() : CarbonImmutable
Sub one century to the instance (using timestamp).
Return values
CarbonImmutable —subRealDay()
public
subRealDay() : CarbonImmutable
Sub one day to the instance (using timestamp).
Return values
CarbonImmutable —subRealDays()
public
subRealDays(int $value = 1) : CarbonImmutable
Sub days (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealDecade()
public
subRealDecade() : CarbonImmutable
Sub one decade to the instance (using timestamp).
Return values
CarbonImmutable —subRealDecades()
public
subRealDecades(int $value = 1) : CarbonImmutable
Sub decades (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealHour()
public
subRealHour() : CarbonImmutable
Sub one hour to the instance (using timestamp).
Return values
CarbonImmutable —subRealHours()
public
subRealHours(int $value = 1) : CarbonImmutable
Sub hours (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealMicro()
public
subRealMicro() : CarbonImmutable
Sub one microsecond to the instance (using timestamp).
Return values
CarbonImmutable —subRealMicros()
public
subRealMicros(int $value = 1) : CarbonImmutable
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealMicrosecond()
public
subRealMicrosecond() : CarbonImmutable
Sub one microsecond to the instance (using timestamp).
Return values
CarbonImmutable —subRealMicroseconds()
public
subRealMicroseconds(int $value = 1) : CarbonImmutable
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealMillennia()
public
subRealMillennia(int $value = 1) : CarbonImmutable
Sub millennia (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealMillennium()
public
subRealMillennium() : CarbonImmutable
Sub one millennium to the instance (using timestamp).
Return values
CarbonImmutable —subRealMilli()
public
subRealMilli() : CarbonImmutable
Sub one millisecond to the instance (using timestamp).
Return values
CarbonImmutable —subRealMillis()
public
subRealMillis(int $value = 1) : CarbonImmutable
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealMillisecond()
public
subRealMillisecond() : CarbonImmutable
Sub one millisecond to the instance (using timestamp).
Return values
CarbonImmutable —subRealMilliseconds()
public
subRealMilliseconds(int $value = 1) : CarbonImmutable
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealMinute()
public
subRealMinute() : CarbonImmutable
Sub one minute to the instance (using timestamp).
Return values
CarbonImmutable —subRealMinutes()
public
subRealMinutes(int $value = 1) : CarbonImmutable
Sub minutes (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealMonth()
public
subRealMonth() : CarbonImmutable
Sub one month to the instance (using timestamp).
Return values
CarbonImmutable —subRealMonths()
public
subRealMonths(int $value = 1) : CarbonImmutable
Sub months (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealQuarter()
public
subRealQuarter() : CarbonImmutable
Sub one quarter to the instance (using timestamp).
Return values
CarbonImmutable —subRealQuarters()
public
subRealQuarters(int $value = 1) : CarbonImmutable
Sub quarters (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealSecond()
public
subRealSecond() : CarbonImmutable
Sub one second to the instance (using timestamp).
Return values
CarbonImmutable —subRealSeconds()
public
subRealSeconds(int $value = 1) : CarbonImmutable
Sub seconds (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealWeek()
public
subRealWeek() : CarbonImmutable
Sub one week to the instance (using timestamp).
Return values
CarbonImmutable —subRealWeeks()
public
subRealWeeks(int $value = 1) : CarbonImmutable
Sub weeks (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subRealYear()
public
subRealYear() : CarbonImmutable
Sub one year to the instance (using timestamp).
Return values
CarbonImmutable —subRealYears()
public
subRealYears(int $value = 1) : CarbonImmutable
Sub years (the $value count passed in) to the instance (using timestamp).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subSecond()
public
subSecond() : CarbonImmutable
Sub one second to the instance (using date interval).
Return values
CarbonImmutable —subSeconds()
public
subSeconds(int $value = 1) : CarbonImmutable
Sub seconds (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subUnitNoOverflow()
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
static —subWeek()
public
subWeek() : CarbonImmutable
Sub one week to the instance (using date interval).
Return values
CarbonImmutable —subWeekday()
public
subWeekday() : CarbonImmutable
Sub one weekday to the instance (using date interval).
Return values
CarbonImmutable —subWeekdays()
public
subWeekdays(int $value = 1) : CarbonImmutable
Sub weekdays (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subWeeks()
public
subWeeks(int $value = 1) : CarbonImmutable
Sub weeks (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subYear()
public
subYear() : CarbonImmutable
Sub one year to the instance (using date interval).
Return values
CarbonImmutable —subYearNoOverflow()
public
subYearNoOverflow() : CarbonImmutable
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subYears()
public
subYears(int $value = 1) : CarbonImmutable
Sub years (the $value count passed in) to the instance (using date interval).
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subYearsNoOverflow()
public
subYearsNoOverflow(int $value = 1) : CarbonImmutable
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subYearsWithNoOverflow()
public
subYearsWithNoOverflow(int $value = 1) : CarbonImmutable
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subYearsWithoutOverflow()
public
subYearsWithoutOverflow(int $value = 1) : CarbonImmutable
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subYearsWithOverflow()
public
subYearsWithOverflow(int $value = 1) : CarbonImmutable
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Parameters
- $value = 1 : int
Return values
CarbonImmutable —subYearWithNoOverflow()
public
subYearWithNoOverflow() : CarbonImmutable
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subYearWithoutOverflow()
public
subYearWithoutOverflow() : CarbonImmutable
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Return values
CarbonImmutable —subYearWithOverflow()
public
subYearWithOverflow() : CarbonImmutable
Sub one year to the instance (using date interval) with overflow explicitly allowed.
Return values
CarbonImmutable —timezone()
public
timezone(DateTimeZone|string $value) : static
Parameters
- $value : DateTimeZone|string
Tags
Return values
static —translatedFormat()
Format as ->format() do (using date replacements patterns from http://php.net/manual/fr/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
string —tz()
Set the timezone or returns the timezone name if no arguments passed.
public
tz([DateTimeZone|string $value = null ]) : static|string
Parameters
- $value : DateTimeZone|string = null
Return values
static|string —utc()
Set the instance's timezone to UTC.
public
utc() : static
Return values
static —utcOffset()
Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
public
utcOffset([int|null $offset = null ]) : int|static
Parameters
- $offset : int|null = null
Return values
int|static —weekday()
Get/set the weekday from 0 (Sunday) to 6 (Saturday).
public
weekday([int|null $value = null ]) : static|int
Parameters
- $value : int|null = null
-
new value for weekday if using as setter.
Return values
static|int —weeksUntil()
public
weeksUntil(mixed $endDate, int $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
Return values
CarbonPeriod —year()
public
year(int $value) : CarbonImmutable
Set current instance year to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —years()
public
years(int $value) : CarbonImmutable
Set current instance year to the given value.
Parameters
- $value : int
Return values
CarbonImmutable —yearsUntil()
public
yearsUntil(mixed $endDate, int $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
Return values
CarbonPeriod —executeCallable()
protected
executeCallable(mixed $macro, mixed ...$parameters) : mixed
Parameters
- $macro : mixed
- $parameters : mixed
Return values
mixed —executeCallableWithContext()
protected
executeCallableWithContext(mixed $macro, mixed ...$parameters) : mixed
Parameters
- $macro : mixed
- $parameters : mixed
Return values
mixed —executeStaticCallable()
protected
static executeStaticCallable(mixed $macro, mixed ...$parameters) : mixed
Parameters
- $macro : mixed
- $parameters : mixed
Return values
mixed —expectDateTime()
Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface.
protected
static expectDateTime(mixed $date[, string|array<string|int, mixed> $other = [] ]) : mixed
Parameters
- $date : mixed
- $other : string|array<string|int, mixed> = []
Tags
Return values
mixed —getGenericMacros()
protected
static getGenericMacros() : mixed
Return values
mixed —getRangesByUnit()
List of minimum and maximums for each unit.
protected
static getRangesByUnit() : array<string|int, mixed>
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
Return values
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([Carbon|DateTimeInterface|string|null $date = null ]) : static
Parameters
- $date : Carbon|DateTimeInterface|string|null = null
Return values
static —safeCreateDateTimeZone()
Creates a DateTimeZone from a string, DateTimeZone or integer offset.
protected
static safeCreateDateTimeZone(DateTimeZone|string|int|null $object[, DateTimeZone|string|int|null $objectDump = null ]) : CarbonTimeZone|false
Parameters
- $object : DateTimeZone|string|int|null
-
original value to get CarbonTimeZone from it.
- $objectDump : DateTimeZone|string|int|null = null
-
dump of the object for error messages.