FileAccess Orion

Date

A simple API extension for DateTime.

<autodoc generated by composer phpdoc>

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
addCenturies()  : CarbonInterface
addCenturiesNoOverflow()  : CarbonInterface
addCenturiesWithNoOverflow()  : CarbonInterface
addCenturiesWithoutOverflow()  : CarbonInterface
addCenturiesWithOverflow()  : CarbonInterface
addCentury()  : CarbonInterface
addCenturyNoOverflow()  : CarbonInterface
addCenturyWithNoOverflow()  : CarbonInterface
addCenturyWithoutOverflow()  : CarbonInterface
addCenturyWithOverflow()  : CarbonInterface
addDay()  : CarbonInterface
addDays()  : CarbonInterface
addDecade()  : CarbonInterface
addDecadeNoOverflow()  : CarbonInterface
addDecades()  : CarbonInterface
addDecadesNoOverflow()  : CarbonInterface
addDecadesWithNoOverflow()  : CarbonInterface
addDecadesWithoutOverflow()  : CarbonInterface
addDecadesWithOverflow()  : CarbonInterface
addDecadeWithNoOverflow()  : CarbonInterface
addDecadeWithoutOverflow()  : CarbonInterface
addDecadeWithOverflow()  : CarbonInterface
addHour()  : CarbonInterface
addHours()  : CarbonInterface
addMicro()  : CarbonInterface
addMicros()  : CarbonInterface
addMicrosecond()  : CarbonInterface
addMicroseconds()  : CarbonInterface
addMillennia()  : CarbonInterface
addMillenniaNoOverflow()  : CarbonInterface
addMillenniaWithNoOverflow()  : CarbonInterface
addMillenniaWithoutOverflow()  : CarbonInterface
addMillenniaWithOverflow()  : CarbonInterface
addMillennium()  : CarbonInterface
addMillenniumNoOverflow()  : CarbonInterface
addMillenniumWithNoOverflow()  : CarbonInterface
addMillenniumWithoutOverflow()  : CarbonInterface
addMillenniumWithOverflow()  : CarbonInterface
addMilli()  : CarbonInterface
addMillis()  : CarbonInterface
addMillisecond()  : CarbonInterface
addMilliseconds()  : CarbonInterface
addMinute()  : CarbonInterface
addMinutes()  : CarbonInterface
addMonth()  : CarbonInterface
addMonthNoOverflow()  : CarbonInterface
addMonths()  : CarbonInterface
addMonthsNoOverflow()  : CarbonInterface
addMonthsWithNoOverflow()  : CarbonInterface
addMonthsWithoutOverflow()  : CarbonInterface
addMonthsWithOverflow()  : CarbonInterface
addMonthWithNoOverflow()  : CarbonInterface
addMonthWithoutOverflow()  : CarbonInterface
addMonthWithOverflow()  : CarbonInterface
addQuarter()  : CarbonInterface
addQuarterNoOverflow()  : CarbonInterface
addQuarters()  : CarbonInterface
addQuartersNoOverflow()  : CarbonInterface
addQuartersWithNoOverflow()  : CarbonInterface
addQuartersWithoutOverflow()  : CarbonInterface
addQuartersWithOverflow()  : CarbonInterface
addQuarterWithNoOverflow()  : CarbonInterface
addQuarterWithoutOverflow()  : CarbonInterface
addQuarterWithOverflow()  : CarbonInterface
addRealCenturies()  : CarbonInterface
addRealCentury()  : CarbonInterface
addRealDay()  : CarbonInterface
addRealDays()  : CarbonInterface
addRealDecade()  : CarbonInterface
addRealDecades()  : CarbonInterface
addRealHour()  : CarbonInterface
addRealHours()  : CarbonInterface
addRealMicro()  : CarbonInterface
addRealMicros()  : CarbonInterface
addRealMicrosecond()  : CarbonInterface
addRealMicroseconds()  : CarbonInterface
addRealMillennia()  : CarbonInterface
addRealMillennium()  : CarbonInterface
addRealMilli()  : CarbonInterface
addRealMillis()  : CarbonInterface
addRealMillisecond()  : CarbonInterface
addRealMilliseconds()  : CarbonInterface
addRealMinute()  : CarbonInterface
addRealMinutes()  : CarbonInterface
addRealMonth()  : CarbonInterface
addRealMonths()  : CarbonInterface
addRealQuarter()  : CarbonInterface
addRealQuarters()  : CarbonInterface
addRealSecond()  : CarbonInterface
addRealSeconds()  : CarbonInterface
addRealWeek()  : CarbonInterface
addRealWeeks()  : CarbonInterface
addRealYear()  : CarbonInterface
addRealYears()  : CarbonInterface
addSecond()  : CarbonInterface
addSeconds()  : CarbonInterface
addUnitNoOverflow()  : static
Add any unit to a new value without overflowing current other unit given.
addWeek()  : CarbonInterface
addWeekday()  : CarbonInterface
addWeekdays()  : CarbonInterface
addWeeks()  : CarbonInterface
addYear()  : CarbonInterface
addYearNoOverflow()  : CarbonInterface
addYears()  : CarbonInterface
addYearsNoOverflow()  : CarbonInterface
addYearsWithNoOverflow()  : CarbonInterface
addYearsWithoutOverflow()  : CarbonInterface
addYearsWithOverflow()  : CarbonInterface
addYearWithNoOverflow()  : CarbonInterface
addYearWithoutOverflow()  : CarbonInterface
addYearWithOverflow()  : CarbonInterface
carbonize()  : static
Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
ceilCenturies()  : CarbonInterface
ceilCentury()  : CarbonInterface
ceilDay()  : CarbonInterface
ceilDays()  : CarbonInterface
ceilDecade()  : CarbonInterface
ceilDecades()  : CarbonInterface
ceilHour()  : CarbonInterface
ceilHours()  : CarbonInterface
ceilMicrosecond()  : CarbonInterface
ceilMicroseconds()  : CarbonInterface
ceilMillennia()  : CarbonInterface
ceilMillennium()  : CarbonInterface
ceilMillisecond()  : CarbonInterface
ceilMilliseconds()  : CarbonInterface
ceilMinute()  : CarbonInterface
ceilMinutes()  : CarbonInterface
ceilMonth()  : CarbonInterface
ceilMonths()  : CarbonInterface
ceilQuarter()  : CarbonInterface
ceilQuarters()  : CarbonInterface
ceilSecond()  : CarbonInterface
ceilSeconds()  : CarbonInterface
ceilYear()  : CarbonInterface
ceilYears()  : CarbonInterface
centuriesUntil()  : CarbonPeriod
clone()  : static
copy()  : static
Get a copy of the instance.
day()  : CarbonInterface
dayOfYear()  : static|int
Get/set the day of year.
days()  : CarbonInterface
daysUntil()  : CarbonPeriod
decadesUntil()  : CarbonPeriod
floorCenturies()  : CarbonInterface
floorCentury()  : CarbonInterface
floorDay()  : CarbonInterface
floorDays()  : CarbonInterface
floorDecade()  : CarbonInterface
floorDecades()  : CarbonInterface
floorHour()  : CarbonInterface
floorHours()  : CarbonInterface
floorMicrosecond()  : CarbonInterface
floorMicroseconds()  : CarbonInterface
floorMillennia()  : CarbonInterface
floorMillennium()  : CarbonInterface
floorMillisecond()  : CarbonInterface
floorMilliseconds()  : CarbonInterface
floorMinute()  : CarbonInterface
floorMinutes()  : CarbonInterface
floorMonth()  : CarbonInterface
floorMonths()  : CarbonInterface
floorQuarter()  : CarbonInterface
floorQuarters()  : CarbonInterface
floorSecond()  : CarbonInterface
floorSeconds()  : CarbonInterface
floorYear()  : CarbonInterface
floorYears()  : CarbonInterface
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()  : CarbonInterface
hours()  : CarbonInterface
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()  : CarbonInterface
micros()  : CarbonInterface
microsecond()  : CarbonInterface
microseconds()  : CarbonInterface
microsecondsUntil()  : CarbonPeriod
microsUntil()  : CarbonPeriod
millenniaUntil()  : CarbonPeriod
milli()  : CarbonInterface
millis()  : CarbonInterface
millisecond()  : CarbonInterface
milliseconds()  : CarbonInterface
millisecondsUntil()  : CarbonPeriod
millisUntil()  : CarbonPeriod
minute()  : CarbonInterface
minutes()  : CarbonInterface
minutesUntil()  : CarbonPeriod
month()  : CarbonInterface
months()  : CarbonInterface
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()  : CarbonInterface
roundCentury()  : CarbonInterface
roundDay()  : CarbonInterface
roundDays()  : CarbonInterface
roundDecade()  : CarbonInterface
roundDecades()  : CarbonInterface
roundHour()  : CarbonInterface
roundHours()  : CarbonInterface
roundMicrosecond()  : CarbonInterface
roundMicroseconds()  : CarbonInterface
roundMillennia()  : CarbonInterface
roundMillennium()  : CarbonInterface
roundMillisecond()  : CarbonInterface
roundMilliseconds()  : CarbonInterface
roundMinute()  : CarbonInterface
roundMinutes()  : CarbonInterface
roundMonth()  : CarbonInterface
roundMonths()  : CarbonInterface
roundQuarter()  : CarbonInterface
roundQuarters()  : CarbonInterface
roundSecond()  : CarbonInterface
roundSeconds()  : CarbonInterface
roundYear()  : CarbonInterface
roundYears()  : CarbonInterface
second()  : CarbonInterface
seconds()  : CarbonInterface
secondsUntil()  : CarbonPeriod
set()  : $this
Set a part of the Carbon object
setDate()  : static
Set the date with gregorian year, month and day numbers.
setDateFrom()  : static
Set the year, month, and date for this instance to that of the passed instance.
setDateTime()  : static
Set the date and time all together.
setDateTimeFrom()  : static
Set the date and time for this instance to that of the passed instance.
setDay()  : CarbonInterface
setDays()  : CarbonInterface
setHour()  : CarbonInterface
setHours()  : CarbonInterface
setISODate()  : static
Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
setMicro()  : CarbonInterface
setMicros()  : CarbonInterface
setMicrosecond()  : CarbonInterface
setMicroseconds()  : CarbonInterface
setMilli()  : CarbonInterface
setMillis()  : CarbonInterface
setMillisecond()  : CarbonInterface
setMilliseconds()  : CarbonInterface
setMinute()  : CarbonInterface
setMinutes()  : CarbonInterface
setMonth()  : CarbonInterface
setMonths()  : CarbonInterface
setSecond()  : CarbonInterface
setSeconds()  : CarbonInterface
setTime()  : static
Resets the current time of the DateTime object to a different time.
setTimeFrom()  : static
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
setTimeFromTimeString()  : static
Set the time by time string.
setTimestamp()  : static
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()  : CarbonInterface
setYears()  : CarbonInterface
shiftTimezone()  : static
Set the instance's timezone from a string or object and add/subtract the offset difference.
shortAbsoluteDiffForHumans()  : string
shortRelativeDiffForHumans()  : string
shortRelativeToNowDiffForHumans()  : string
shortRelativeToOtherDiffForHumans()  : string
singularUnit()  : string
Returns standardized singular of a given singular/plural unit name (in English).
subCenturies()  : CarbonInterface
subCenturiesNoOverflow()  : CarbonInterface
subCenturiesWithNoOverflow()  : CarbonInterface
subCenturiesWithoutOverflow()  : CarbonInterface
subCenturiesWithOverflow()  : CarbonInterface
subCentury()  : CarbonInterface
subCenturyNoOverflow()  : CarbonInterface
subCenturyWithNoOverflow()  : CarbonInterface
subCenturyWithoutOverflow()  : CarbonInterface
subCenturyWithOverflow()  : CarbonInterface
subDay()  : CarbonInterface
subDays()  : CarbonInterface
subDecade()  : CarbonInterface
subDecadeNoOverflow()  : CarbonInterface
subDecades()  : CarbonInterface
subDecadesNoOverflow()  : CarbonInterface
subDecadesWithNoOverflow()  : CarbonInterface
subDecadesWithoutOverflow()  : CarbonInterface
subDecadesWithOverflow()  : CarbonInterface
subDecadeWithNoOverflow()  : CarbonInterface
subDecadeWithoutOverflow()  : CarbonInterface
subDecadeWithOverflow()  : CarbonInterface
subHour()  : CarbonInterface
subHours()  : CarbonInterface
subMicro()  : CarbonInterface
subMicros()  : CarbonInterface
subMicrosecond()  : CarbonInterface
subMicroseconds()  : CarbonInterface
subMillennia()  : CarbonInterface
subMillenniaNoOverflow()  : CarbonInterface
subMillenniaWithNoOverflow()  : CarbonInterface
subMillenniaWithoutOverflow()  : CarbonInterface
subMillenniaWithOverflow()  : CarbonInterface
subMillennium()  : CarbonInterface
subMillenniumNoOverflow()  : CarbonInterface
subMillenniumWithNoOverflow()  : CarbonInterface
subMillenniumWithoutOverflow()  : CarbonInterface
subMillenniumWithOverflow()  : CarbonInterface
subMilli()  : CarbonInterface
subMillis()  : CarbonInterface
subMillisecond()  : CarbonInterface
subMilliseconds()  : CarbonInterface
subMinute()  : CarbonInterface
subMinutes()  : CarbonInterface
subMonth()  : CarbonInterface
subMonthNoOverflow()  : CarbonInterface
subMonths()  : CarbonInterface
subMonthsNoOverflow()  : CarbonInterface
subMonthsWithNoOverflow()  : CarbonInterface
subMonthsWithoutOverflow()  : CarbonInterface
subMonthsWithOverflow()  : CarbonInterface
subMonthWithNoOverflow()  : CarbonInterface
subMonthWithoutOverflow()  : CarbonInterface
subMonthWithOverflow()  : CarbonInterface
subQuarter()  : CarbonInterface
subQuarterNoOverflow()  : CarbonInterface
subQuarters()  : CarbonInterface
subQuartersNoOverflow()  : CarbonInterface
subQuartersWithNoOverflow()  : CarbonInterface
subQuartersWithoutOverflow()  : CarbonInterface
subQuartersWithOverflow()  : CarbonInterface
subQuarterWithNoOverflow()  : CarbonInterface
subQuarterWithoutOverflow()  : CarbonInterface
subQuarterWithOverflow()  : CarbonInterface
subRealCenturies()  : CarbonInterface
subRealCentury()  : CarbonInterface
subRealDay()  : CarbonInterface
subRealDays()  : CarbonInterface
subRealDecade()  : CarbonInterface
subRealDecades()  : CarbonInterface
subRealHour()  : CarbonInterface
subRealHours()  : CarbonInterface
subRealMicro()  : CarbonInterface
subRealMicros()  : CarbonInterface
subRealMicrosecond()  : CarbonInterface
subRealMicroseconds()  : CarbonInterface
subRealMillennia()  : CarbonInterface
subRealMillennium()  : CarbonInterface
subRealMilli()  : CarbonInterface
subRealMillis()  : CarbonInterface
subRealMillisecond()  : CarbonInterface
subRealMilliseconds()  : CarbonInterface
subRealMinute()  : CarbonInterface
subRealMinutes()  : CarbonInterface
subRealMonth()  : CarbonInterface
subRealMonths()  : CarbonInterface
subRealQuarter()  : CarbonInterface
subRealQuarters()  : CarbonInterface
subRealSecond()  : CarbonInterface
subRealSeconds()  : CarbonInterface
subRealWeek()  : CarbonInterface
subRealWeeks()  : CarbonInterface
subRealYear()  : CarbonInterface
subRealYears()  : CarbonInterface
subSecond()  : CarbonInterface
subSeconds()  : CarbonInterface
subUnitNoOverflow()  : static
Subtract any unit to a new value without overflowing current other unit given.
subWeek()  : CarbonInterface
subWeekday()  : CarbonInterface
subWeekdays()  : CarbonInterface
subWeeks()  : CarbonInterface
subYear()  : CarbonInterface
subYearNoOverflow()  : CarbonInterface
subYears()  : CarbonInterface
subYearsNoOverflow()  : CarbonInterface
subYearsWithNoOverflow()  : CarbonInterface
subYearsWithoutOverflow()  : CarbonInterface
subYearsWithOverflow()  : CarbonInterface
subYearWithNoOverflow()  : CarbonInterface
subYearWithoutOverflow()  : CarbonInterface
subYearWithOverflow()  : CarbonInterface
timezone()  : static
translatedFormat()  : string
Format as ->format() do (using date replacements patterns from 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()  : CarbonInterface
years()  : CarbonInterface
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

public int $century

the century of this instance

$dayName

public string $dayName

long name of weekday translated according to Carbon locale, in english if no translation available for current language

$dayOfWeek

public int $dayOfWeek

0 (for Sunday) through 6 (for Saturday)

$dayOfWeekIso

public int $dayOfWeekIso

1 (for Monday) through 7 (for Sunday)

$dayOfYear

public int $dayOfYear

1 through 366

$daysInMonth

public int $daysInMonth

number of days in the given month

$daysInYear

public int $daysInYear

365 or 366

$decade

public int $decade

the decade of this instance

$dst

public bool $dst

daylight savings time indicator, true if DST, false otherwise

$englishDayOfWeek

public string $englishDayOfWeek

the day of week in English

$englishMonth

public string $englishMonth

the month in English

$firstWeekDay

public int $firstWeekDay

0 through 6

$isoWeek

public int $isoWeek

1 through 53

$isoWeeksInYear

public int $isoWeeksInYear

51 through 53

$isoWeekYear

public int $isoWeekYear

year according to ISO week format

$lastWeekDay

public int $lastWeekDay

0 through 6

$latinMeridiem

public string $latinMeridiem

"am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark)

$latinUpperMeridiem

public string $latinUpperMeridiem

"AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark)

$local

public bool $local

checks if the timezone is local, true if local, false otherwise

$locale

public string $locale

locale of the current instance

$localeDayOfWeek

public string $localeDayOfWeek

the day of week in current locale LC_TIME

$localeMonth

public string $localeMonth

the month in current locale LC_TIME

$meridiem

public string $meridiem

lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language

$microsecond

public int $microsecond

$millennium

public int $millennium

the millennium of this instance

$millisecond

public int $millisecond

$milliseconds

public int $milliseconds

$minDayName

public string $minDayName

very short name of weekday translated according to Carbon locale, in english if no translation available for current language

$minute

public int $minute

$monthName

public string $monthName

long name of month translated according to Carbon locale, in english if no translation available for current language

$noZeroHour

public int $noZeroHour

current hour from 1 to 24

$offset

public int $offset

the timezone offset in seconds from UTC

$offsetHours

public int $offsetHours

the timezone offset in hours from UTC

$offsetMinutes

public int $offsetMinutes

the timezone offset in minutes from UTC

$quarter

public int $quarter

the quarter of this instance, 1 - 4

$second

public int $second

$shortDayName

public string $shortDayName

short name of weekday translated according to Carbon locale, in english if no translation available for current language

$shortEnglishDayOfWeek

public string $shortEnglishDayOfWeek

the abbreviated day of week in English

$shortEnglishMonth

public string $shortEnglishMonth

the abbreviated month in English

$shortLocaleDayOfWeek

public string $shortLocaleDayOfWeek

the abbreviated day of week in current locale LC_TIME

$shortLocaleMonth

public string $shortLocaleMonth

the abbreviated month in current locale LC_TIME

$shortMonthName

public string $shortMonthName

short name of month translated according to Carbon locale, in english if no translation available for current language

$timestamp

public int $timestamp

seconds since the Unix Epoch

$timezoneAbbreviatedName

public string $timezoneAbbreviatedName

the current timezone abbreviated name

$timezoneName

public string $timezoneName

the current timezone name

$tzAbbrName

public string $tzAbbrName

alias of $timezoneAbbreviatedName

$tzName

public string $tzName

alias of $timezoneName

$upperMeridiem

public string $upperMeridiem

uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language

$utc

public bool $utc

checks if the timezone is UTC, true if UTC, false otherwise

$week

public int $week

1 through 53

$weekNumberInMonth

public int $weekNumberInMonth

1 through 5

$weekOfMonth

public int $weekOfMonth

1 through 5

$weekOfYear

public int $weekOfYear

ISO-8601 week number of year, weeks starting on Monday

$weeksInYear

public int $weeksInYear

51 through 53

$weekYear

public int $weekYear

year according to week format

$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
throws
UnknownMethodException|BadMethodCallException|ReflectionException|Throwable
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
throws
BadMethodCallException
Return values
mixed

__get()

Get a part of the Carbon object

public __get(string $name) : string|int|bool|DateTimeZone|null
Parameters
$name : string
Tags
throws
UnknownGetterException
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
throws
UnknownSetterException|ReflectionException
Return values
void

addCenturies()

public addCenturies(int $value = 1) : CarbonInterface

Add centuries (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addCenturiesNoOverflow()

public addCenturiesNoOverflow(int $value = 1) : CarbonInterface

Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addCenturiesWithNoOverflow()

public addCenturiesWithNoOverflow(int $value = 1) : CarbonInterface

Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addCenturiesWithoutOverflow()

public addCenturiesWithoutOverflow(int $value = 1) : CarbonInterface

Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addCenturiesWithOverflow()

public addCenturiesWithOverflow(int $value = 1) : CarbonInterface

Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

addCenturyNoOverflow()

public addCenturyNoOverflow() : CarbonInterface

Add one century to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addCenturyWithNoOverflow()

public addCenturyWithNoOverflow() : CarbonInterface

Add one century to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addCenturyWithoutOverflow()

public addCenturyWithoutOverflow() : CarbonInterface

Add one century to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addCenturyWithOverflow()

public addCenturyWithOverflow() : CarbonInterface

Add one century to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

addDays()

public addDays(int $value = 1) : CarbonInterface

Add days (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addDecadeNoOverflow()

public addDecadeNoOverflow() : CarbonInterface

Add one decade to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addDecades()

public addDecades(int $value = 1) : CarbonInterface

Add decades (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addDecadesNoOverflow()

public addDecadesNoOverflow(int $value = 1) : CarbonInterface

Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addDecadesWithNoOverflow()

public addDecadesWithNoOverflow(int $value = 1) : CarbonInterface

Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addDecadesWithoutOverflow()

public addDecadesWithoutOverflow(int $value = 1) : CarbonInterface

Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addDecadesWithOverflow()

public addDecadesWithOverflow(int $value = 1) : CarbonInterface

Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

addDecadeWithNoOverflow()

public addDecadeWithNoOverflow() : CarbonInterface

Add one decade to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addDecadeWithoutOverflow()

public addDecadeWithoutOverflow() : CarbonInterface

Add one decade to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addDecadeWithOverflow()

public addDecadeWithOverflow() : CarbonInterface

Add one decade to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

addHours()

public addHours(int $value = 1) : CarbonInterface

Add hours (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addMicros()

public addMicros(int $value = 1) : CarbonInterface

Add microseconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addMicroseconds()

public addMicroseconds(int $value = 1) : CarbonInterface

Add microseconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addMillennia()

public addMillennia(int $value = 1) : CarbonInterface

Add millennia (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addMillenniaNoOverflow()

public addMillenniaNoOverflow(int $value = 1) : CarbonInterface

Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addMillenniaWithNoOverflow()

public addMillenniaWithNoOverflow(int $value = 1) : CarbonInterface

Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addMillenniaWithoutOverflow()

public addMillenniaWithoutOverflow(int $value = 1) : CarbonInterface

Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addMillenniaWithOverflow()

public addMillenniaWithOverflow(int $value = 1) : CarbonInterface

Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

addMillenniumNoOverflow()

public addMillenniumNoOverflow() : CarbonInterface

Add one millennium to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addMillenniumWithNoOverflow()

public addMillenniumWithNoOverflow() : CarbonInterface

Add one millennium to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addMillenniumWithoutOverflow()

public addMillenniumWithoutOverflow() : CarbonInterface

Add one millennium to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addMillenniumWithOverflow()

public addMillenniumWithOverflow() : CarbonInterface

Add one millennium to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

addMillis()

public addMillis(int $value = 1) : CarbonInterface

Add milliseconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addMilliseconds()

public addMilliseconds(int $value = 1) : CarbonInterface

Add milliseconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addMinutes()

public addMinutes(int $value = 1) : CarbonInterface

Add minutes (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addMonthNoOverflow()

public addMonthNoOverflow() : CarbonInterface

Add one month to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addMonths()

public addMonths(int $value = 1) : CarbonInterface

Add months (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addMonthsNoOverflow()

public addMonthsNoOverflow(int $value = 1) : CarbonInterface

Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addMonthsWithNoOverflow()

public addMonthsWithNoOverflow(int $value = 1) : CarbonInterface

Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addMonthsWithoutOverflow()

public addMonthsWithoutOverflow(int $value = 1) : CarbonInterface

Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addMonthsWithOverflow()

public addMonthsWithOverflow(int $value = 1) : CarbonInterface

Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

addMonthWithNoOverflow()

public addMonthWithNoOverflow() : CarbonInterface

Add one month to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addMonthWithoutOverflow()

public addMonthWithoutOverflow() : CarbonInterface

Add one month to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addMonthWithOverflow()

public addMonthWithOverflow() : CarbonInterface

Add one month to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

addQuarterNoOverflow()

public addQuarterNoOverflow() : CarbonInterface

Add one quarter to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addQuarters()

public addQuarters(int $value = 1) : CarbonInterface

Add quarters (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addQuartersNoOverflow()

public addQuartersNoOverflow(int $value = 1) : CarbonInterface

Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addQuartersWithNoOverflow()

public addQuartersWithNoOverflow(int $value = 1) : CarbonInterface

Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addQuartersWithoutOverflow()

public addQuartersWithoutOverflow(int $value = 1) : CarbonInterface

Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addQuartersWithOverflow()

public addQuartersWithOverflow(int $value = 1) : CarbonInterface

Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

addQuarterWithNoOverflow()

public addQuarterWithNoOverflow() : CarbonInterface

Add one quarter to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addQuarterWithoutOverflow()

public addQuarterWithoutOverflow() : CarbonInterface

Add one quarter to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addQuarterWithOverflow()

public addQuarterWithOverflow() : CarbonInterface

Add one quarter to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

addRealCenturies()

public addRealCenturies(int $value = 1) : CarbonInterface

Add centuries (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealDays()

public addRealDays(int $value = 1) : CarbonInterface

Add days (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealDecades()

public addRealDecades(int $value = 1) : CarbonInterface

Add decades (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealHours()

public addRealHours(int $value = 1) : CarbonInterface

Add hours (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealMicros()

public addRealMicros(int $value = 1) : CarbonInterface

Add microseconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealMicroseconds()

public addRealMicroseconds(int $value = 1) : CarbonInterface

Add microseconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealMillennia()

public addRealMillennia(int $value = 1) : CarbonInterface

Add millennia (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealMillis()

public addRealMillis(int $value = 1) : CarbonInterface

Add milliseconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealMilliseconds()

public addRealMilliseconds(int $value = 1) : CarbonInterface

Add milliseconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealMinutes()

public addRealMinutes(int $value = 1) : CarbonInterface

Add minutes (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealMonths()

public addRealMonths(int $value = 1) : CarbonInterface

Add months (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealQuarters()

public addRealQuarters(int $value = 1) : CarbonInterface

Add quarters (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealSeconds()

public addRealSeconds(int $value = 1) : CarbonInterface

Add seconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealWeeks()

public addRealWeeks(int $value = 1) : CarbonInterface

Add weeks (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addRealYears()

public addRealYears(int $value = 1) : CarbonInterface

Add years (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

addSeconds()

public addSeconds(int $value = 1) : CarbonInterface

Add seconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

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

addWeekdays()

public addWeekdays(int $value = 1) : CarbonInterface

Add weekdays (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addWeeks()

public addWeeks(int $value = 1) : CarbonInterface

Add weeks (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addYearNoOverflow()

public addYearNoOverflow() : CarbonInterface

Add one year to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addYears()

public addYears(int $value = 1) : CarbonInterface

Add years (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

addYearsNoOverflow()

public addYearsNoOverflow(int $value = 1) : CarbonInterface

Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addYearsWithNoOverflow()

public addYearsWithNoOverflow(int $value = 1) : CarbonInterface

Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addYearsWithoutOverflow()

public addYearsWithoutOverflow(int $value = 1) : CarbonInterface

Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

addYearsWithOverflow()

public addYearsWithOverflow(int $value = 1) : CarbonInterface

Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

addYearWithNoOverflow()

public addYearWithNoOverflow() : CarbonInterface

Add one year to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addYearWithoutOverflow()

public addYearWithoutOverflow() : CarbonInterface

Add one year to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

addYearWithOverflow()

public addYearWithOverflow() : CarbonInterface

Add one year to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

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) : CarbonInterface

Ceil the current instance century with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilCentury()

public ceilCentury(float $precision = 1) : CarbonInterface

Ceil the current instance century with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilDay()

public ceilDay(float $precision = 1) : CarbonInterface

Ceil the current instance day with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilDays()

public ceilDays(float $precision = 1) : CarbonInterface

Ceil the current instance day with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilDecade()

public ceilDecade(float $precision = 1) : CarbonInterface

Ceil the current instance decade with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilDecades()

public ceilDecades(float $precision = 1) : CarbonInterface

Ceil the current instance decade with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilHour()

public ceilHour(float $precision = 1) : CarbonInterface

Ceil the current instance hour with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilHours()

public ceilHours(float $precision = 1) : CarbonInterface

Ceil the current instance hour with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMicrosecond()

public ceilMicrosecond(float $precision = 1) : CarbonInterface

Ceil the current instance microsecond with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMicroseconds()

public ceilMicroseconds(float $precision = 1) : CarbonInterface

Ceil the current instance microsecond with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMillennia()

public ceilMillennia(float $precision = 1) : CarbonInterface

Ceil the current instance millennium with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMillennium()

public ceilMillennium(float $precision = 1) : CarbonInterface

Ceil the current instance millennium with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMillisecond()

public ceilMillisecond(float $precision = 1) : CarbonInterface

Ceil the current instance millisecond with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMilliseconds()

public ceilMilliseconds(float $precision = 1) : CarbonInterface

Ceil the current instance millisecond with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMinute()

public ceilMinute(float $precision = 1) : CarbonInterface

Ceil the current instance minute with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMinutes()

public ceilMinutes(float $precision = 1) : CarbonInterface

Ceil the current instance minute with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMonth()

public ceilMonth(float $precision = 1) : CarbonInterface

Ceil the current instance month with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilMonths()

public ceilMonths(float $precision = 1) : CarbonInterface

Ceil the current instance month with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilQuarter()

public ceilQuarter(float $precision = 1) : CarbonInterface

Ceil the current instance quarter with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilQuarters()

public ceilQuarters(float $precision = 1) : CarbonInterface

Ceil the current instance quarter with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilSecond()

public ceilSecond(float $precision = 1) : CarbonInterface

Ceil the current instance second with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilSeconds()

public ceilSeconds(float $precision = 1) : CarbonInterface

Ceil the current instance second with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilYear()

public ceilYear(float $precision = 1) : CarbonInterface

Ceil the current instance year with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

ceilYears()

public ceilYears(float $precision = 1) : CarbonInterface

Ceil the current instance year with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

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
alias

copy

Get a copy of the instance.

Return values
static

copy()

Get a copy of the instance.

public copy() : static
Return values
static

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

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) : CarbonInterface

Truncate the current instance century with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorCentury()

public floorCentury(float $precision = 1) : CarbonInterface

Truncate the current instance century with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorDay()

public floorDay(float $precision = 1) : CarbonInterface

Truncate the current instance day with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorDays()

public floorDays(float $precision = 1) : CarbonInterface

Truncate the current instance day with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorDecade()

public floorDecade(float $precision = 1) : CarbonInterface

Truncate the current instance decade with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorDecades()

public floorDecades(float $precision = 1) : CarbonInterface

Truncate the current instance decade with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorHour()

public floorHour(float $precision = 1) : CarbonInterface

Truncate the current instance hour with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorHours()

public floorHours(float $precision = 1) : CarbonInterface

Truncate the current instance hour with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMicrosecond()

public floorMicrosecond(float $precision = 1) : CarbonInterface

Truncate the current instance microsecond with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMicroseconds()

public floorMicroseconds(float $precision = 1) : CarbonInterface

Truncate the current instance microsecond with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMillennia()

public floorMillennia(float $precision = 1) : CarbonInterface

Truncate the current instance millennium with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMillennium()

public floorMillennium(float $precision = 1) : CarbonInterface

Truncate the current instance millennium with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMillisecond()

public floorMillisecond(float $precision = 1) : CarbonInterface

Truncate the current instance millisecond with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMilliseconds()

public floorMilliseconds(float $precision = 1) : CarbonInterface

Truncate the current instance millisecond with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMinute()

public floorMinute(float $precision = 1) : CarbonInterface

Truncate the current instance minute with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMinutes()

public floorMinutes(float $precision = 1) : CarbonInterface

Truncate the current instance minute with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMonth()

public floorMonth(float $precision = 1) : CarbonInterface

Truncate the current instance month with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorMonths()

public floorMonths(float $precision = 1) : CarbonInterface

Truncate the current instance month with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorQuarter()

public floorQuarter(float $precision = 1) : CarbonInterface

Truncate the current instance quarter with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorQuarters()

public floorQuarters(float $precision = 1) : CarbonInterface

Truncate the current instance quarter with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorSecond()

public floorSecond(float $precision = 1) : CarbonInterface

Truncate the current instance second with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorSeconds()

public floorSeconds(float $precision = 1) : CarbonInterface

Truncate the current instance second with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorYear()

public floorYear(float $precision = 1) : CarbonInterface

Truncate the current instance year with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

floorYears()

public floorYears(float $precision = 1) : CarbonInterface

Truncate the current instance year with given precision.

Parameters
$precision = 1 : float
Return values
CarbonInterface

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
throws
UnknownGetterException
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

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

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

microseconds()

public microseconds(int $value) : CarbonInterface

Set current instance microsecond to the given value.

Parameters
$value : int
Return values
CarbonInterface

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

milliseconds()

public milliseconds(int $value) : CarbonInterface

Set current instance millisecond to the given value.

Parameters
$value : int
Return values
CarbonInterface

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

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

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") : CarbonInterface

Round the current instance century with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundCentury()

public roundCentury(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance century with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundDay()

public roundDay(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance day with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundDays()

public roundDays(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance day with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundDecade()

public roundDecade(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance decade with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundDecades()

public roundDecades(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance decade with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundHour()

public roundHour(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance hour with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundHours()

public roundHours(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance hour with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMicrosecond()

public roundMicrosecond(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance microsecond with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMicroseconds()

public roundMicroseconds(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance microsecond with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMillennia()

public roundMillennia(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance millennium with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMillennium()

public roundMillennium(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance millennium with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMillisecond()

public roundMillisecond(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance millisecond with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMilliseconds()

public roundMilliseconds(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance millisecond with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMinute()

public roundMinute(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance minute with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMinutes()

public roundMinutes(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance minute with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMonth()

public roundMonth(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance month with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundMonths()

public roundMonths(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance month with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundQuarter()

public roundQuarter(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance quarter with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundQuarters()

public roundQuarters(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance quarter with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundSecond()

public roundSecond(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance second with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundSeconds()

public roundSeconds(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance second with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundYear()

public roundYear(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance year with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

roundYears()

public roundYears(float $precision = 1, string $function = "round") : CarbonInterface

Round the current instance year with given precision using the given function.

Parameters
$precision = 1 : float
$function = "round" : string
Return values
CarbonInterface

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
throws
ImmutableException|UnknownSetterException
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
see
https://php.net/manual/en/datetime.setdate.php
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

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
see
https://php.net/manual/en/datetime.setisodate.php
Return values
static

setMicrosecond()

public setMicrosecond(int $value) : CarbonInterface

Set current instance microsecond to the given value.

Parameters
$value : int
Return values
CarbonInterface

setMicroseconds()

public setMicroseconds(int $value) : CarbonInterface

Set current instance microsecond to the given value.

Parameters
$value : int
Return values
CarbonInterface

setMillisecond()

public setMillisecond(int $value) : CarbonInterface

Set current instance millisecond to the given value.

Parameters
$value : int
Return values
CarbonInterface

setMilliseconds()

public setMilliseconds(int $value) : CarbonInterface

Set current instance millisecond to the given value.

Parameters
$value : int
Return values
CarbonInterface

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
see
https://php.net/manual/en/datetime.settime.php
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

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
deprecated

To avoid conflict between different third-party libraries, static setters should not be used. You should rather use UTF-8 language packages on every machine.

Set if UTF8 will be used for localized date/time.

Return values
mixed

setWeekendDays()

public static setWeekendDays(array<string|int, mixed> $days) : void
Parameters
$days : array<string|int, mixed>
Tags
deprecated

To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider week-end is always saturday and sunday, and if you have some custom week-end days to handle, give to those days an other name and create a macro for them:

        ```
        Carbon::macro('isDayOff', function ($date) {
            return $date->isSunday() || $date->isMonday();
        });
        Carbon::macro('isNotDayOff', function ($date) {
            return !$date->isDayOff();
        });
        if ($someDate->isDayOff()) ...
        if ($someDate->isNotDayOff()) ...
        // Add 5 not-off days
        $count = 5;
        while ($someDate->isDayOff() || ($count-- > 0)) {
            $someDate->addDay();
        }
        ```

Set weekend days

Return values
void

setWeekEndsAt()

public static setWeekEndsAt(int $day) : void
Parameters
$day : int
Tags
deprecated

To avoid conflict between different third-party libraries, static setters should not be used. Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the start of week according to current locale selected and implicitly the end of week.

Set the last day of week

Return values
void

setWeekStartsAt()

public static setWeekStartsAt(int $day) : void
Parameters
$day : int

week start day

Tags
deprecated

To avoid conflict between different third-party libraries, static setters should not be used. Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the 'first_day_of_week' locale setting to change the start of week according to current locale selected and implicitly the end of week.

Set the first day of week

Return values
void

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) : CarbonInterface

Sub centuries (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subCenturiesNoOverflow()

public subCenturiesNoOverflow(int $value = 1) : CarbonInterface

Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subCenturiesWithNoOverflow()

public subCenturiesWithNoOverflow(int $value = 1) : CarbonInterface

Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subCenturiesWithoutOverflow()

public subCenturiesWithoutOverflow(int $value = 1) : CarbonInterface

Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subCenturiesWithOverflow()

public subCenturiesWithOverflow(int $value = 1) : CarbonInterface

Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

subCenturyNoOverflow()

public subCenturyNoOverflow() : CarbonInterface

Sub one century to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subCenturyWithNoOverflow()

public subCenturyWithNoOverflow() : CarbonInterface

Sub one century to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subCenturyWithoutOverflow()

public subCenturyWithoutOverflow() : CarbonInterface

Sub one century to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subCenturyWithOverflow()

public subCenturyWithOverflow() : CarbonInterface

Sub one century to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

subDays()

public subDays(int $value = 1) : CarbonInterface

Sub days (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subDecadeNoOverflow()

public subDecadeNoOverflow() : CarbonInterface

Sub one decade to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subDecades()

public subDecades(int $value = 1) : CarbonInterface

Sub decades (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subDecadesNoOverflow()

public subDecadesNoOverflow(int $value = 1) : CarbonInterface

Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subDecadesWithNoOverflow()

public subDecadesWithNoOverflow(int $value = 1) : CarbonInterface

Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subDecadesWithoutOverflow()

public subDecadesWithoutOverflow(int $value = 1) : CarbonInterface

Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subDecadesWithOverflow()

public subDecadesWithOverflow(int $value = 1) : CarbonInterface

Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

subDecadeWithNoOverflow()

public subDecadeWithNoOverflow() : CarbonInterface

Sub one decade to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subDecadeWithoutOverflow()

public subDecadeWithoutOverflow() : CarbonInterface

Sub one decade to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subDecadeWithOverflow()

public subDecadeWithOverflow() : CarbonInterface

Sub one decade to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

subHours()

public subHours(int $value = 1) : CarbonInterface

Sub hours (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subMicros()

public subMicros(int $value = 1) : CarbonInterface

Sub microseconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subMicroseconds()

public subMicroseconds(int $value = 1) : CarbonInterface

Sub microseconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subMillennia()

public subMillennia(int $value = 1) : CarbonInterface

Sub millennia (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subMillenniaNoOverflow()

public subMillenniaNoOverflow(int $value = 1) : CarbonInterface

Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subMillenniaWithNoOverflow()

public subMillenniaWithNoOverflow(int $value = 1) : CarbonInterface

Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subMillenniaWithoutOverflow()

public subMillenniaWithoutOverflow(int $value = 1) : CarbonInterface

Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subMillenniaWithOverflow()

public subMillenniaWithOverflow(int $value = 1) : CarbonInterface

Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

subMillenniumNoOverflow()

public subMillenniumNoOverflow() : CarbonInterface

Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subMillenniumWithNoOverflow()

public subMillenniumWithNoOverflow() : CarbonInterface

Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subMillenniumWithoutOverflow()

public subMillenniumWithoutOverflow() : CarbonInterface

Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subMillenniumWithOverflow()

public subMillenniumWithOverflow() : CarbonInterface

Sub one millennium to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

subMillis()

public subMillis(int $value = 1) : CarbonInterface

Sub milliseconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subMilliseconds()

public subMilliseconds(int $value = 1) : CarbonInterface

Sub milliseconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subMinutes()

public subMinutes(int $value = 1) : CarbonInterface

Sub minutes (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subMonthNoOverflow()

public subMonthNoOverflow() : CarbonInterface

Sub one month to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subMonths()

public subMonths(int $value = 1) : CarbonInterface

Sub months (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subMonthsNoOverflow()

public subMonthsNoOverflow(int $value = 1) : CarbonInterface

Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subMonthsWithNoOverflow()

public subMonthsWithNoOverflow(int $value = 1) : CarbonInterface

Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subMonthsWithoutOverflow()

public subMonthsWithoutOverflow(int $value = 1) : CarbonInterface

Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subMonthsWithOverflow()

public subMonthsWithOverflow(int $value = 1) : CarbonInterface

Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

subMonthWithNoOverflow()

public subMonthWithNoOverflow() : CarbonInterface

Sub one month to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subMonthWithoutOverflow()

public subMonthWithoutOverflow() : CarbonInterface

Sub one month to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subMonthWithOverflow()

public subMonthWithOverflow() : CarbonInterface

Sub one month to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

subQuarterNoOverflow()

public subQuarterNoOverflow() : CarbonInterface

Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subQuarters()

public subQuarters(int $value = 1) : CarbonInterface

Sub quarters (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subQuartersNoOverflow()

public subQuartersNoOverflow(int $value = 1) : CarbonInterface

Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subQuartersWithNoOverflow()

public subQuartersWithNoOverflow(int $value = 1) : CarbonInterface

Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subQuartersWithoutOverflow()

public subQuartersWithoutOverflow(int $value = 1) : CarbonInterface

Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subQuartersWithOverflow()

public subQuartersWithOverflow(int $value = 1) : CarbonInterface

Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

subQuarterWithNoOverflow()

public subQuarterWithNoOverflow() : CarbonInterface

Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subQuarterWithoutOverflow()

public subQuarterWithoutOverflow() : CarbonInterface

Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subQuarterWithOverflow()

public subQuarterWithOverflow() : CarbonInterface

Sub one quarter to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

subRealCenturies()

public subRealCenturies(int $value = 1) : CarbonInterface

Sub centuries (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealDays()

public subRealDays(int $value = 1) : CarbonInterface

Sub days (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealDecades()

public subRealDecades(int $value = 1) : CarbonInterface

Sub decades (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealHours()

public subRealHours(int $value = 1) : CarbonInterface

Sub hours (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealMicros()

public subRealMicros(int $value = 1) : CarbonInterface

Sub microseconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealMicroseconds()

public subRealMicroseconds(int $value = 1) : CarbonInterface

Sub microseconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealMillennia()

public subRealMillennia(int $value = 1) : CarbonInterface

Sub millennia (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealMillis()

public subRealMillis(int $value = 1) : CarbonInterface

Sub milliseconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealMilliseconds()

public subRealMilliseconds(int $value = 1) : CarbonInterface

Sub milliseconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealMinutes()

public subRealMinutes(int $value = 1) : CarbonInterface

Sub minutes (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealMonths()

public subRealMonths(int $value = 1) : CarbonInterface

Sub months (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealQuarters()

public subRealQuarters(int $value = 1) : CarbonInterface

Sub quarters (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealSeconds()

public subRealSeconds(int $value = 1) : CarbonInterface

Sub seconds (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealWeeks()

public subRealWeeks(int $value = 1) : CarbonInterface

Sub weeks (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subRealYears()

public subRealYears(int $value = 1) : CarbonInterface

Sub years (the $value count passed in) to the instance (using timestamp).

Parameters
$value = 1 : int
Return values
CarbonInterface

subSeconds()

public subSeconds(int $value = 1) : CarbonInterface

Sub seconds (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

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

subWeekdays()

public subWeekdays(int $value = 1) : CarbonInterface

Sub weekdays (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subWeeks()

public subWeeks(int $value = 1) : CarbonInterface

Sub weeks (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subYearNoOverflow()

public subYearNoOverflow() : CarbonInterface

Sub one year to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subYears()

public subYears(int $value = 1) : CarbonInterface

Sub years (the $value count passed in) to the instance (using date interval).

Parameters
$value = 1 : int
Return values
CarbonInterface

subYearsNoOverflow()

public subYearsNoOverflow(int $value = 1) : CarbonInterface

Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subYearsWithNoOverflow()

public subYearsWithNoOverflow(int $value = 1) : CarbonInterface

Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subYearsWithoutOverflow()

public subYearsWithoutOverflow(int $value = 1) : CarbonInterface

Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.

Parameters
$value = 1 : int
Return values
CarbonInterface

subYearsWithOverflow()

public subYearsWithOverflow(int $value = 1) : CarbonInterface

Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.

Parameters
$value = 1 : int
Return values
CarbonInterface

subYearWithNoOverflow()

public subYearWithNoOverflow() : CarbonInterface

Sub one year to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subYearWithoutOverflow()

public subYearWithoutOverflow() : CarbonInterface

Sub one year to the instance (using date interval) with overflow explicitly forbidden.

Return values
CarbonInterface

subYearWithOverflow()

public subYearWithOverflow() : CarbonInterface

Sub one year to the instance (using date interval) with overflow explicitly allowed.

Return values
CarbonInterface

timezone()

public timezone(DateTimeZone|string $value) : static
Parameters
$value : DateTimeZone|string
Tags
alias

setTimezone

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

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
throws
InvalidTypeException
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.

Tags
throws
InvalidTimeZoneException
Return values
CarbonTimeZone|false

Search results