class Carbon extendsDateTime implementsCarbonInterface

A simple API extension for DateTime.

Traits

A simple API extension for DateTime.
Trait Boundaries.
Trait Comparison.
Trait Converter.
Trait Creator.
Trait Difference.
Trait Macros.
Trait Modifiers.
Trait Mutability.
Trait Options.
Trait Rounding.
Trait Serialization.
Trait Timestamp.
Trait Units.
Trait Week.
Trait Mixin.
Trait Cast.
Trait Localization.
Trait to call rounding methods to interval or the interval of a period.

Properties

int $year
int $month
int $daysInMonth from Serialization
int $quarter Depends on the following methods: from Serialization
protectedbool $endOfTime from Comparison
protectedbool $startOfTime from Comparison
staticprotectedstring|Closure|null $toStringFormat Format to use for __toString method when type juggling occurs. from Converter
protectedstring $constructedObjectId True when parent::__construct has been called. from ObjectInitialisation
staticprotectedarray $lastErrors The errors that can occur. from Creator
staticprotectedarray $macroContextStack Stack of macro instance contexts. from Mixin
staticprotectedarray $globalMacros The registered macros. from Macro
staticprotectedarray $globalGenericMacros The registered generic macros. from Macro
staticprotectedint $midDayAt Midday/noon hour. from Modifiers
staticprotectedTranslatorInterface $translator Default translator. from Localization
protectedTranslatorInterface $localTranslator Specific translator of the current instance. from Localization
staticprotectedint $humanDiffOptions Options for diffForHumans(). from Localization
staticint $PHPIntSize Customizable PHP_INT_SIZE override. from Options
staticprotectedint|string $weekStartsAt First day of week. from Options
staticprotectedint|string $weekEndsAt Last day of week. from Options
staticprotectedarray $weekendDays Days of weekend. from Options
staticprotectedarray $regexFormats Format regex patterns. from Options
staticprotectedarray $regexFormatModifiers Format modifiers (such as available in createFromFormat) regex patterns. from Options
staticprotectedbool $monthsOverflow Indicates if months should be calculated with overflow. from Options
staticprotectedbool $yearsOverflow Indicates if years should be calculated with overflow. from Options
staticprotectedbool $strictModeEnabled Indicates if the strict mode is in use. from Options
staticprotectedstring|callable|null $formatFunction Function to call instead of format. from Options
staticprotectedstring|callable|null $createFromFormatFunction Function to call instead of createFromFormat. from Options
staticprotectedstring|callable|null $parseFunction Function to call instead of parse. from Options
protectedbool|null $localMonthsOverflow Indicates if months should be calculated with overflow. from Options
protectedbool|null $localYearsOverflow Indicates if years should be calculated with overflow. from Options
protectedbool|null $localStrictModeEnabled Indicates if the strict mode is in use. from Options
protectedbool|null $localHumanDiffOptions Options for diffForHumans and forHumans methods. from Options
protectedstring|null $localToStringFormat Format to use on string cast. from Options
protectedstring|null $localSerializer Format to use on JSON serialization. from Options
protectedarray|null $localMacros Instance-specific macros. from Options
protectedarray|null $localGenericMacros Instance-specific generic macros. from Options
protectedstring|callable|null $localFormatFunction Function to call instead of format. from Options
staticprotectedcallable|null $serializer The custom Carbon JSON serializer. from Serialization
protectedstring[] $dumpProperties List of key to use for dump/serialization. from Serialization
protectedstring|null $dumpLocale Locale to dump comes here before serialization. from Serialization
protectedarray|null $dumpDateProperties Embed date properties to dump in a dedicated variables so it won't overlap native DateTime ones. from Serialization
staticprotectedClosure|Test|null $testNow A test Carbon instance to be returned when now instances are created. from Test
staticprotectedstring|null $testDefaultTimezone The timezone to resto to when clearing the time mock. from Test
int $daysInYear from Week
int $dayOfWeek from Week
int $dayOfYear 1 through 366
staticprotectedarray $days Names of days of the week. from Date
staticprotectedbool $utf8 Will UTF8 encoding be used to print localized date/time ? from Date
staticprotectedarray $units List of unit and magic methods associated as doc-comments. from Date
int $yearIso
int $day
int $hour
int $minute
int $second
int $micro
int $microsecond
int|float|string $timestamp seconds since the Unix Epoch
string $englishDayOfWeek the day of week in English
string $shortEnglishDayOfWeek the abbreviated day of week in English
string $englishMonth the month in English
string $shortEnglishMonth the abbreviated month in English
int $milliseconds
int $millisecond
int $milli
int $week 1 through 53
int $isoWeek 1 through 53
int $weekYear year according to week format
int $isoWeekYear year according to ISO week format
int $age does a diffInYears() with default parameters
int $offset the timezone offset in seconds from UTC
int $offsetMinutes the timezone offset in minutes from UTC
int $offsetHours the timezone offset in hours from UTC
CarbonTimeZone $timezone the current timezone
CarbonTimeZone $tz alias of $timezone

Methods

startOfDay()

Resets the time to 00:00:00 start of day

endOfDay()

Resets the time to 23:59:59.999999 end of day

startOfMonth()

Resets the date to the first day of the month and the time to 00:00:00

endOfMonth()

Resets the date to end of the month and time to 23:59:59.999999

startOfQuarter()

Resets the date to the first day of the quarter and the time to 00:00:00

endOfQuarter()

Resets the date to end of the quarter and time to 23:59:59.999999

startOfYear()

Resets the date to the first day of the year and the time to 00:00:00

endOfYear()

Resets the date to end of the year and time to 23:59:59.999999

startOfDecade()

Resets the date to the first day of the decade and the time to 00:00:00

endOfDecade()

Resets the date to end of the decade and time to 23:59:59.999999

startOfCentury()

Resets the date to the first day of the century and the time to 00:00:00

endOfCentury()

Resets the date to end of the century and time to 23:59:59.999999

startOfMillennium()

Resets the date to the first day of the millennium and the time to 00:00:00

endOfMillennium()

Resets the date to end of the millennium and time to 23:59:59.999999

static
startOfWeek(int $day =1)

No description

from Week
endOfWeek(int$weekEndsAt =null)

Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999

startOfHour()

Modify to start of current hour, minutes and seconds become 0

endOfHour()

Modify to end of current hour, minutes and seconds become 59

startOfMinute()

Modify to start of current minute, seconds become 0

endOfMinute()

Modify to end of current minute, seconds become 59

startOfSecond()

Modify to start of current second, microseconds become 0

endOfSecond()

Modify to end of current second, microseconds become 999999

startOf(string$unit,array...$params)

Modify to start of current given unit.

endOf(string$unit,array...$params)

Modify to end of current given unit.

bool
eq(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is equal to another

bool
equalTo(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is equal to another

bool
ne(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is not equal to another

bool
notEqualTo(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is not equal to another

bool
gt(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than another

bool
greaterThan(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than another

bool
isAfter(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than another

bool
gte(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than or equal to another

bool
greaterThanOrEqualTo(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than or equal to another

bool
lt(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is less (before) than another

bool
lessThan($date)

No description

bool
isBefore(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is less (before) than another

bool
lte(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is less (before) or equal to another

bool
lessThanOrEqualTo(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is less (before) or equal to another

bool
between(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2,bool$equal =true)

Determines if the instance is between two others.

bool
betweenIncluded(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)

Determines if the instance is between two others, bounds included.

bool
betweenExcluded(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)

Determines if the instance is between two others, bounds excluded.

bool
isBetween(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2,bool$equal =true)

Determines if the instance is between two others

bool
isWeekday()

Determines if the instance is a weekday.

bool
isWeekend()

Determines if the instance is a weekend day.

bool
isYesterday()

Determines if the instance is yesterday.

bool
isToday()

Determines if the instance is today.

bool
isTomorrow()

Determines if the instance is tomorrow.

bool
isFuture()

Determines if the instance is in the future, ie. greater (after) than now.

bool
isPast()

Determines if the instance is in the past, ie. less (before) than now.

bool
isLeapYear()

Determines if the instance is a leap year.

bool
isLongYear()

Determines if the instance is a long year

bool
isSameAs(string$format,Carbon|DateTimeInterface|string|null$date =null)

Compares the formatted values of the two dates.

bool
isSameUnit(string$unit,Carbon|DateTimeInterface|null$date =null)

Determines if the instance is in the current unit given.

bool
isCurrentUnit(string$unit)

Determines if the instance is in the current unit given.

bool
isSameQuarter(Carbon|DateTimeInterface|string|null$date =null,bool$ofSameYear =true)

Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).

bool
isSameMonth(Carbon|DateTimeInterface|null$date =null,bool$ofSameYear =true)

Checks if the passed in date is in the same month as the instance´s month.

bool
isDayOfWeek(int$dayOfWeek)

Checks if this day is a specific day of the week.

bool
isBirthday(Carbon|DateTimeInterface|null$date =null)

Check if its the birthday. Compares the date/month values of the two dates.

bool
isLastOfMonth()

Check if today is the last day of the Month

bool
isStartOfDay(bool$checkMicroseconds =false)

Check if the instance is start of day / midnight.

bool
isEndOfDay(bool$checkMicroseconds =false)

Check if the instance is end of day.

bool
isMidnight()

Check if the instance is start of day / midnight.

bool
isMidday()

Check if the instance is midday.

static bool
hasFormat(string$date,string$format)

Checks if the (date)time string is in a given format.

static bool
hasFormatWithModifiers(string$date,string$format)

Checks if the (date)time string is in a given format.

static bool
canBeCreatedFromFormat(string$date,string$format)

Checks if the (date)time string is in a given format and valid to create a new instance.

bool
is(string$tester)

Returns true if the current date matches the given string.

bool
isStartOfTime()

Returns true if the date was created using CarbonImmutable::startOfTime()

bool
isEndOfTime()

Returns true if the date was created using CarbonImmutable::endOfTime()

static
resolveCarbon($date =null)

No description

static
copy()

No description

from Week
static
nowWithSameTz()

No description

static void
resetToStringFormat()

Reset the format used to the default when type juggling a Carbon instance to a string

from Converter
static void
setToStringFormat(string|Closure|null$format)deprecated

No description

from Converter
format($format)

No description

from Converter
string
rawFormat(string$format)

No description

from Converter
string
__toString()

Format the instance as a string using the set format

from Converter
string
toDateString()

Format the instance as date

from Converter
string
toFormattedDateString()

Format the instance as a readable date

from Converter
string
toFormattedDayDateString()

Format the instance with the day, and a readable date

from Converter
string
toTimeString(string$unitPrecision ='second')

Format the instance as time

from Converter
string
toDateTimeString(string$unitPrecision ='second')

Format the instance as date and time

from Converter
static string
getTimeFormatByPrecision(string$unitPrecision)

Return a format from H:i to H:i:s.u according to given unit precision.

from Converter
string
toDateTimeLocalString(string$unitPrecision ='second')

Format the instance as date and time T-separated with no timezone

from Converter
string
toDayDateTimeString()

Format the instance with day, date and time

from Converter
string
toAtomString()

Format the instance as ATOM

from Converter
string
toCookieString()

Format the instance as COOKIE

from Converter
string
toIso8601String()

Format the instance as ISO8601

from Converter
string
toRfc822String()

Format the instance as RFC822

from Converter
string
toIso8601ZuluString(string$unitPrecision ='second')

Convert the instance to UTC and return as Zulu ISO8601

from Converter
string
toRfc850String()

Format the instance as RFC850

from Converter
string
toRfc1036String()

Format the instance as RFC1036

from Converter
string
toRfc1123String()

Format the instance as RFC1123

from Converter
string
toRfc2822String()

Format the instance as RFC2822

from Converter
string
toRfc3339String(bool$extended =false)

Format the instance as RFC3339

from Converter
string
toRssString()

Format the instance as RSS

from Converter
string
toW3cString()

Format the instance as W3C

from Converter
string
toRfc7231String()

Format the instance as RFC7231

from Converter
array
toArray()

Get default array representation.

from Converter
object
toObject()

Get default object representation.

from Converter
string
toString()

Returns english human readable complete date string.

from Converter
null|string
toISOString(bool$keepOffset =false)

Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: 1977-04-22T01:00:00-05:00).

from Converter
string
toJSON()

No description

toDateTime()

Return native DateTime PHP object matching the current instance.

from Converter
toDateTimeImmutable()

Return native toDateTimeImmutable PHP object matching the current instance.

from Converter
toDate()

No description

from Converter
toPeriod(DateTimeInterface|Carbon|CarbonImmutable|int|null$end =null,int|DateInterval|string|null$interval =null,string|null$unit =null)

Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).

from Converter
range(DateTimeInterface|Carbon|CarbonImmutable|null$end =null,int|DateInterval|string|null$interval =null,string|null$unit =null)

Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).

from Converter
__construct(DateTimeInterface|string|null$time =null,DateTimeZone|string|null$tz =null)

Create a new Carbon instance.

from Creator
__clone()

Update constructedObjectId on cloned.

from Creator
static Creator
instance(DateTimeInterface$date)

Create a Carbon instance from a DateTime one.

from Creator
static Creator
rawParse(string|DateTimeInterface|null$time =null,DateTimeZone|string|null$tz =null)

Create a carbon instance from a string.

from Creator
static Creator
parse(string|DateTimeInterface|null$time =null,DateTimeZone|string|null$tz =null)

Create a carbon instance from a string.

from Creator
static Creator
parseFromLocale(string$time,string|null$locale =null,DateTimeZone|string|null$tz =null)

Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).

from Creator
static Creator
now(DateTimeZone|string|null$tz =null)

Get a Carbon instance for the current date and time.

from Creator
static Creator
today(DateTimeZone|string|null$tz =null)

Create a Carbon instance for today.

from Creator
static Creator
tomorrow(DateTimeZone|string|null$tz =null)

Create a Carbon instance for tomorrow.

from Creator
static Creator
yesterday(DateTimeZone|string|null$tz =null)

Create a Carbon instance for yesterday.

from Creator
static Creator
maxValue()

Create a Carbon instance for the greatest supported date.

from Creator
static Creator
minValue()

Create a Carbon instance for the lowest supported date.

from Creator
static Creator|false
create(int|null$year =0,int|null$month =1,int|null$day =1,int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)

Create a new Carbon instance from a specific date and time.

from Creator
static Creator|false
createSafe(int|null$year =null,int|null$month =null,int|null$day =null,int|null$hour =null,int|null$minute =null,int|null$second =null,DateTimeZone|string|null$tz =null)

Create a new safe Carbon instance from a specific date and time.

from Creator
static Creator
createStrict(int|null$year =0,int|null$month =1,int|null$day =1,int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)

Create a new Carbon instance from a specific date and time using strict validation.

from Creator
static Creator
createFromDate(int|null$year =null,int|null$month =null,int|null$day =null,DateTimeZone|string|null$tz =null)

Create a Carbon instance from just a date. The time portion is set to now.

from Creator
static Creator
createMidnightDate(int|null$year =null,int|null$month =null,int|null$day =null,DateTimeZone|string|null$tz =null)

Create a Carbon instance from just a date. The time portion is set to midnight.

from Creator
static Creator
createFromTime(int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)

Create a Carbon instance from just a time. The date portion is set to today.

from Creator
static Creator
createFromTimeString(string$time,DateTimeZone|string|null$tz =null)

Create a Carbon instance from a time string. The date portion is set to today.

from Creator
static Creator|false
rawCreateFromFormat(string$format,string$time,DateTimeZone|string|false|null$tz =null)

Create a Carbon instance from a specific format.

from Creator
static 
createFromFormat($format,$time,$tz =null)

No description

from Creator
static Creator|false
createFromIsoFormat(string$format,string$time,DateTimeZone|string|false|null$tz =null,string|null$locale ='en',TranslatorInterface$translator =null)

Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).

from Creator
static Creator|false
createFromLocaleFormat(string$format,string$locale,string$time,DateTimeZone|string|false|null$tz =null)

Create a Carbon instance from a specific format and a string in a given language.

from Creator
static Creator|false
createFromLocaleIsoFormat(string$format,string$locale,string$time,DateTimeZone|string|false|null$tz =null)

Create a Carbon instance from a specific ISO format and a string in a given language.

from Creator
static Creator|null
make(mixed$var)

Make a Carbon instance from given variable if possible.

from Creator
static 
getLastErrors()

No description

from Creator
static 
fixDiffInterval(DateInterval$diff,bool$absolute)

No description

diff($date =null,$absolute =false)

No description

diffAsCarbonInterval(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference as a CarbonInterval instance.

int
diffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in years

int
diffInQuarters(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in quarters rounded down.

int
diffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in months rounded down.

int
diffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weeks rounded down.

int
diffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in days rounded down.

int
diffInDaysFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in days using a filter closure rounded down.

int
diffInHoursFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours using a filter closure rounded down.

int
diffFiltered(CarbonInterval$ci,Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference by the given interval using a filter closure.

int
diffInWeekdays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weekdays rounded down.

int
diffInWeekendDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weekend days using a filter rounded down.

int
diffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours rounded down.

int
diffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours rounded down using timestamps.

int
diffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in minutes rounded down.

int
diffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in minutes rounded down using timestamps.

int
diffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in seconds rounded down.

int
diffInMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in microseconds.

int
diffInMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in milliseconds rounded down.

int
diffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in seconds using timestamps.

int
diffInRealMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in microseconds using timestamps.

int
diffInRealMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in milliseconds rounded down using timestamps.

float
floatDiffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in seconds as float (microsecond-precision).

float
floatDiffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in minutes as float (microsecond-precision).

float
floatDiffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours as float (microsecond-precision).

float
floatDiffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in days as float (microsecond-precision).

float
floatDiffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weeks as float (microsecond-precision).

float
floatDiffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in months as float (microsecond-precision).

float
floatDiffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in year as float (microsecond-precision).

float
floatDiffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in seconds as float (microsecond-precision) using timestamps.

float
floatDiffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in minutes as float (microsecond-precision) using timestamps.

float
floatDiffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours as float (microsecond-precision) using timestamps.

float
floatDiffInRealDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in days as float (microsecond-precision).

float
floatDiffInRealWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weeks as float (microsecond-precision).

float
floatDiffInRealMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in months as float (microsecond-precision) using timestamps.

float
floatDiffInRealYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in year as float (microsecond-precision) using timestamps.

int
secondsSinceMidnight()

The number of seconds since midnight.

int
secondsUntilEndOfDay()

The number of seconds until 23:59:59.

string
diffForHumans(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).

string
from(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

No description

since($other =null,$syntax =null,$short =false,$parts =1,$options =null)

No description

string
to(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from an other instance given (or now if null given) to current instance.

string
until(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

No description

string
fromNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from current instance to now.

string
toNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from an other instance given to now

string
ago(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from an other instance given to now

string
timespan($other =null,$timezone =null)

Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).

string
calendar(Carbon|DateTimeInterface|string|null$referenceTime =null,array$formats =[])

Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, or a calendar date (e.g. "10/29/2017") otherwise.

static void
mixin(object|string$mixin)

Mix another object into the class.

from Mixin
static mixed
bindMacroContext(Mixin|null$context,callable$callable)

Stack a Carbon context from inside calls of self::this() and execute a given action.

from Mixin
static Mixin|null
context()

Return the current context from inside a macro callee or a null if static.

from Mixin
static Mixin
this()

Return the current context from inside a macro callee or a new one if static.

from Mixin
static void
macro(string$name,object|callable$macro)

Register a custom macro.

from Macro
static 
resetMacros()

Remove all macros and generic macros.

from Macro
static void
genericMacro(object|callable$macro,int$priority =0)

Register a custom macro.

from Macro
static bool
hasMacro(string$name)

Checks if macro is registered globally.

from Macro
static callable|null
getMacro(string$name)

Get the raw callable macro registered globally for a given name.

from Macro
bool
hasLocalMacro(string$name)

Checks if macro is registered globally or locally.

from Macro
callable|null
getLocalMacro(string$name)

Get the raw callable macro registered globally or locally for a given name.

from Macro
static int
getMidDayAt()

get midday/noon hour

from Modifiers
static void
setMidDayAt(int$hour)deprecated

No description

from Modifiers
midDay()

Modify to midday, default to self::$midDayAt

from Modifiers
static
next(int|string $day =null)

No description

from Week
nextWeekday()

Go forward to the next weekday.

from Modifiers
previousWeekday()

Go backward to the previous weekday.

from Modifiers
nextWeekendDay()

Go forward to the next weekend day.

from Modifiers
previousWeekendDay()

Go backward to the previous weekend day.

from Modifiers
previous(string|int|null$modifier =null)

Modify to the previous occurrence of a given modifier such as a day of the week. If no dayOfWeek is provided, modify to the previous occurrence of the current day of the week. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

from Modifiers
firstOfMonth(int|null$dayOfWeek =null)

Modify to the first occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the first day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

from Modifiers
lastOfMonth(int|null$dayOfWeek =null)

Modify to the last occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the last day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

from Modifiers
mixed
nthOfMonth(int$nth,int$dayOfWeek)

Modify to the given occurrence of a given day of the week in the current month. If the calculated occurrence is outside the scope of the current month, then return false and no modifications are made.

from Modifiers
firstOfQuarter(int|null$dayOfWeek =null)

Modify to the first occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the first day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

from Modifiers
lastOfQuarter(int|null$dayOfWeek =null)

Modify to the last occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the last day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

from Modifiers
mixed
nthOfQuarter(int$nth,int$dayOfWeek)

Modify to the given occurrence of a given day of the week in the current quarter. If the calculated occurrence is outside the scope of the current quarter, then return false and no modifications are made.

from Modifiers
firstOfYear(int|null$dayOfWeek =null)

Modify to the first occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the first day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

from Modifiers
lastOfYear(int|null$dayOfWeek =null)

Modify to the last occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the last day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

from Modifiers
mixed
nthOfYear(int$nth,int$dayOfWeek)

Modify to the given occurrence of a given day of the week in the current year. If the calculated occurrence is outside the scope of the current year, then return false and no modifications are made.

from Modifiers
average(Carbon|DateTimeInterface|null$date =null)

Modify the current instance to the average of a given instance (default now) and the current instance (second-precision).

from Modifiers
closest(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)

Get the closest date from the instance (second-precision).

from Modifiers
farthest(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)

Get the farthest date from the instance (second-precision).

from Modifiers
min(Carbon|DateTimeInterface|mixed$date =null)

Get the minimum instance between a given instance (default now) and the current instance.

from Modifiers
minimum(Carbon|DateTimeInterface|mixed$date =null)

Get the minimum instance between a given instance (default now) and the current instance.

from Modifiers
max(Carbon|DateTimeInterface|mixed$date =null)

Get the maximum instance between a given instance (default now) and the current instance.

from Modifiers
maximum(Carbon|DateTimeInterface|mixed$date =null)

Get the maximum instance between a given instance (default now) and the current instance.

from Modifiers
modify($modify)

No description

from Modifiers
change(string$modifier)

Similar to native modify() method of DateTime but can handle more grammars.

from Modifiers
cast(string$className)

Cast the current instance into the given class.

from Cast
static bool
isMutable()

Returns true if the current class/instance is mutable.

static bool
isImmutable()

Returns true if the current class/instance is immutable.

toMutable()

Return a mutable copy of the instance.

toImmutable()

Return a immutable copy of the instance.

static 
setHumanDiffOptions(int$humanDiffOptions)deprecated

No description

static 
enableHumanDiffOption(int$humanDiffOption)deprecated

No description

static 
disableHumanDiffOption(int$humanDiffOption)deprecated

No description

static int
getHumanDiffOptions()

Return default humanDiff() options (merged flags as integer).

static TranslatorInterface
getTranslator()

Get the default translator instance in use.

static void
setTranslator(TranslatorInterface$translator)

Set the default translator instance to use.

bool
hasLocalTranslator()

Return true if the current instance has its own translator.

TranslatorInterface
getLocalTranslator()

Get the translator of the current instance or the default if none set.

$this
setLocalTranslator(TranslatorInterface$translator)

Set the translator for the current instance.

static string
getTranslationMessageWith(TranslatorInterface$translator,string$key,string|null$locale =null,string|null$default =null)

Returns raw translation message for a given key.

string
getTranslationMessage(string$key,string|null$locale =null,string|null$default =null,TranslatorInterface$translator =null)

Returns raw translation message for a given key.

static string
translateWith(TranslatorInterface$translator,string$key,array$parameters =[],null$number =null)

Translate using translation string or callback available.

string
translate(string$key,array$parameters =[],string|int|float|null$number =null,TranslatorInterface|null$translator =null,bool$altNumbers =false)

Translate using translation string or callback available.

string
translateNumber(int$number)

Returns the alternative number for a given integer if available in the current locale.

static string
translateTimeString(string$timeString,string|null$from =null,string|null$to =null,int$mode =CarbonInterface::TRANSLATE_ALL)

Translate a time string from a locale to an other.

string
translateTimeStringTo(string$timeString,string|null$to =null)

Translate a time string from the current locale ($date->locale()) to an other.

$this|string
locale(string$locale =null,string...$fallbackLocales)

Get/set the locale for the current instance.

static string
getLocale()

Get the current translator locale.

static bool
setLocale(string$locale)

Set the current translator locale and indicate if the source locale file exists.

static 
setFallbackLocale(string$locale)

Set the fallback locale.

static string|null
getFallbackLocale()

Get the fallback locale.

static mixed
executeWithLocale(string$locale,callable$func)

Set the current locale to the given, execute the passed function, reset the locale to previous one, then return the result of the closure (or null if the closure was void).

static bool
localeHasShortUnits(string$locale)

Returns true if the given locale is internally supported and has short-units support.

static bool
localeHasDiffSyntax(string$locale)

Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).

static bool
localeHasDiffOneDayWords(string$locale)

Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).

static bool
localeHasDiffTwoDayWords(string$locale)

Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).

static bool
localeHasPeriodSyntax(string$locale)

Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).

static array
getAvailableLocales()

Returns the list of internally available locales and already loaded custom locales.

static Language[]
getAvailableLocalesInfo()

Returns list of Language object for each available locale. This object allow you to get the ISO name, native name, region and variant of the locale.

static TranslatorInterface
translator()

Initialize the default translator instance if necessary.

string|null
getTranslatorLocale(null$translator =null)

Get the locale of a given translator.

static LocaleAwareInterface|null
getLocaleAwareTranslator(LocaleAwareInterface|null$translator =null)

Throw an error if passed object is not LocaleAwareInterface.

static 
useStrictMode(bool$strictModeEnabled =true)deprecated

No description

from Options
static bool
isStrictModeEnabled()

Returns true if the strict mode is globally in use, false else.

from Options
static void
useMonthsOverflow(bool$monthsOverflow =true)deprecated

No description

from Options
static void
resetMonthsOverflow()deprecated

No description

from Options
static bool
shouldOverflowMonths()

Get the month overflow global behavior (can be overridden in specific instances).

from Options
static void
useYearsOverflow(bool$yearsOverflow =true)deprecated

No description

from Options
static void
resetYearsOverflow()deprecated

No description

from Options
static bool
shouldOverflowYears()

Get the month overflow global behavior (can be overridden in specific instances).

from Options
$this|Options
settings(array$settings)

Set specific options.

from Options
array
getSettings()

Returns current local settings.

from Options
array
__debugInfo()

Show truthy properties on var_dump().

from Options
addExtraDebugInfos($infos)

No description

from Options
CarbonImmutable
shiftTimezone($timezone)

Set the timezone

from Options
callRoundMethod(string$method,array$parameters)

No description

roundWith($precision,$function)

No description

roundUnit(string$unit,float|int$precision =1,string$function ='round')

Round the current instance at the given unit with given precision if specified and the given function.

from Rounding
floorUnit(string$unit,float|int$precision =1)

Truncate the current instance at the given unit with given precision if specified.

from Rounding
ceilUnit(string$unit,float|int$precision =1)

Ceil the current instance at the given unit with given precision if specified.

from Rounding
round(float|int|string|DateInterval|null$precision =1,string$function ='round')

Round the current instance second with given precision if specified.

from Rounding
floor(float|int|string|DateInterval|null$precision =1)

Round the current instance second with given precision if specified.

from Rounding
ceil(float|int|string|DateInterval|null$precision =1)

Ceil the current instance second with given precision if specified.

from Rounding
roundWeek(int$weekStartsAt =null)

Round the current instance week.

from Rounding
floorWeek(int$weekStartsAt =null)

Truncate the current instance week.

from Rounding
ceilWeek(int$weekStartsAt =null)

Ceil the current instance week.

from Rounding
string
serialize()

Return a serialized string of the instance.

static Serialization
fromSerialized(string$value)

Create an instance from a serialized string.

static 
__set_state($dump)

No description

array
__sleep()

Returns the list of properties to dump on serialize() called on.

__serialize()

No description

__wakeup()

No description

__unserialize(array$data)

No description

jsonSerialize()

No description

static void
serializeUsing(callable$callback)deprecated

No description

cleanupDumpProperties()

Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.

static 
setTestNow(DateTimeInterface|Closure|Test|string|false|null$testNow =null)

Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: - A call to the static now() method, ex. Carbon::now() - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - When a string containing the desired time is passed to Carbon::parse().

from Test
static 
setTestNowAndTimezone($testNow =null,$tz =null)

Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: - A call to the static now() method, ex. Carbon::now() - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - When a string containing the desired time is passed to Carbon::parse().

from Test
static mixed
withTestNow(DateTimeInterface|Closure|Test|string|false|null$testNow =null,Closure|null$callback =null)

Temporarily sets a static date to be used within the callback.

from Test
static Closure|Test
getTestNow()

Get the Carbon instance (real or mock) to be returned when a "now" instance is created.

from Test
static bool
hasTestNow()

Determine if there is a valid test instance set. A valid test instance is anything that is not null.

from Test
static CarbonImmutable|Carbon|null
getMockedTestNow(string|DateTimeZone$tz)

Get the mocked date passed in setTestNow() and if it's a Closure, execute it.

from Test
static 
mockConstructorParameters($time,$tz)

No description

from Test
static Timestamp
createFromTimestamp(float|int|string$timestamp,DateTimeZone|string|null$tz =null)

Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).

from Timestamp
static Timestamp
createFromTimestampUTC(float|int|string$timestamp)

Create a Carbon instance from an timestamp keeping the timezone to UTC.

from Timestamp
static Timestamp
createFromTimestampMsUTC(float|int|string$timestamp)

Create a Carbon instance from a timestamp in milliseconds.

from Timestamp
static Timestamp
createFromTimestampMs(float|int|string$timestamp,DateTimeZone|string|null$tz =null)

Create a Carbon instance from a timestamp in milliseconds.

from Timestamp
timestamp(float|int|string$unixTimestamp)

Set the instance's timestamp.

from Timestamp
float
getPreciseTimestamp(int$precision =6)

Returns a timestamp rounded with the given precision (6 by default).

from Timestamp
float
valueOf()

Returns the milliseconds timestamps used amongst other by Date javascript objects.

from Timestamp
int
getTimestampMs()

Returns the timestamp with millisecond precision.

from Timestamp
int
unix()

No description

from Timestamp
addRealUnit(string$unit,int$value =1)

Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.

from Units
subRealUnit($unit,$value =1)

No description

from Units
static bool
isModifiableUnit(string$unit)

Returns true if a property can be changed via setter.

from Units
rawAdd(DateInterval$interval)

Call native PHP DateTime/DateTimeImmutable add() method.

from Units
add($unit,$value =1,$overflow =null)

No description

from Units
addUnit(string$unit,int$value =1,bool|null$overflow =null)

Add given units to the current instance.

from Units
subUnit(string$unit,int$value =1,bool|null$overflow =null)

Subtract given units to the current instance.

from Units
rawSub(DateInterval$interval)

Call native PHP DateTime/DateTimeImmutable sub() method.

from Units
sub($unit,$value =1,$overflow =null)

No description

from Units
subtract(string|DateInterval$unit,int$value =1,bool|null$overflow =null)

Subtract given units or interval to the current instance.

from Units
int|Week
isoWeekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

Set/get the week number of year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

from Week
int|Week
weekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

Set/get the week number of year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

from Week
int
isoWeeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)

Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

from Week
int
weeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)

Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

from Week
int|Week
week(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

Get/set the week number using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

from Week
int|Week
isoWeek(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

Get/set the week number using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

from Week
static
addWeeks(int $weeks =1)

No description

from Week
static
dayOfYear(int $dayOfYear)

No description

from Week
static
subWeeks(int $weeks =1)

No description

from Week
static
year(int $year =null)

No description

from Week
static CarbonTimeZone|false
safeCreateDateTimeZone(DateTimeZone|string|int|null$object,DateTimeZone|string|int|null$objectDump =null)

Creates a DateTimeZone from a string, DateTimeZone or integer offset.

from Date
getTimezone()

No description

from Date
static array
getRangesByUnit(int$daysInMonth =31)

List of minimum and maximums for each unit.

from Date
clone()

No description

from Date
avoidMutation()

Clone the current instance if it's mutable.

from Date
static 
expectDateTime(mixed$date,string|array$other =[])

Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface.

from Date
resolveUTC(Carbon|DateTimeInterface|string|null$date =null)

Return the Carbon instance passed through, a now instance in UTC if null given or parse the input if string given (using current timezone then switching to UTC).

from Date
carbonize(Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null$date =null)

Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.

from Date
string|int|bool|DateTimeZone|null
__get(string$name)

Get a part of the Carbon object

from Date
string|int|bool|DateTimeZone|null
get(string$name)

Get a part of the Carbon object

from Date
bool
__isset(string$name)

Check if an attribute exists on the object

from Date
void
__set(string$name,string|int|DateTimeZone$value)

Set a part of the Carbon object

from Date
$this
set(string|array$name,string|int|DateTimeZone$value =null)

Set a part of the Carbon object

from Date
getTranslatedFormByRegExp($baseKey,$keySuffix,$context,$subKey,$defaultValue)

No description

from Date
string
getTranslatedDayName(string|null$context =null,string$keySuffix ='',string|null$defaultValue =null)

Get the translation of the current week day name (with context for languages with multiple forms).

from Date
string
getTranslatedShortDayName(string|null$context =null)

Get the translation of the current short week day name (with context for languages with multiple forms).

from Date
string
getTranslatedMinDayName(string|null$context =null)

Get the translation of the current abbreviated week day name (with context for languages with multiple forms).

from Date
string
getTranslatedMonthName(string|null$context =null,string$keySuffix ='',string|null$defaultValue =null)

Get the translation of the current month day name (with context for languages with multiple forms).

from Date
string
getTranslatedShortMonthName(string|null$context =null)

Get the translation of the current short month day name (with context for languages with multiple forms).

from Date
Date|int
weekday(int|null$value =null)

Get/set the weekday from 0 (Sunday) to 6 (Saturday).

from Date
Date|int
isoWeekday(int|null$value =null)

Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).

from Date
setUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)

Set any unit to a new value without overflowing current other unit given.

from Date
addUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)

Add any unit to a new value without overflowing current other unit given.

from Date
subUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)

Subtract any unit to a new value without overflowing current other unit given.

from Date
int|Date
utcOffset(int$minuteOffset =null)

Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.

from Date
setDate($year,$month,$day)

No description

from Date
setISODate($year,$week,$day =1)

No description

from Date
setDateTime(int$year,int$month,int$day,int$hour,int$minute,int$second =0,int$microseconds =0)

Set the date and time all together.

from Date
setTime($hour,$minute,$second =0,$microseconds =0)

No description

from Date
setTimestamp($unixTimestamp)

No description

from Date
setTimeFromTimeString(string$time)

Set the time by time string.

from Date
timezone(DateTimeZone|string$value)

No description

from Date
Date|string
tz(DateTimeZone|string$value =null)

Set the timezone or returns the timezone name if no arguments passed.

from Date
setTimezone($value)

No description

from Date
utc()

Set the instance's timezone to UTC.

from Date
setDateFrom(Carbon|DateTimeInterface$date =null)

Set the year, month, and date for this instance to that of the passed instance.

from Date
setTimeFrom(Carbon|DateTimeInterface$date =null)

Set the hour, minute, second and microseconds for this instance to that of the passed instance.

from Date
setDateTimeFrom(Carbon|DateTimeInterface$date =null)

Set the date and time for this instance to that of the passed instance.

from Date
static array
getDays()

Get the days of the week

from Date
static int
getWeekStartsAt()

Get the first day of week

from Date
static void
setWeekStartsAt(int|string$day)deprecated

No description

from Date
static int
getWeekEndsAt()

Get the last day of week

from Date
static void
setWeekEndsAt(int|string$day)deprecated

No description

from Date
static array
getWeekendDays()

Get weekend days

from Date
static void
setWeekendDays(array$days)deprecated

No description

from Date
static bool
hasRelativeKeywords(string$time)

Determine if a time string will produce a relative date.

from Date
static 
setUtf8(bool$utf8)deprecated

No description

from Date
string
formatLocalized(string$format)deprecated

Format the instance with the current locale. You can set the current locale using setlocale() https://php.net/setlocale.

from Date
array
getIsoFormats(string|null$locale =null)

Returns list of locale formats for ISO formatting.

from Date
array
getCalendarFormats(string|null$locale =null)

Returns list of calendar formats for ISO formatting.

from Date
static array
getIsoUnits()

Returns list of locale units for ISO formatting.

from Date
string
getPaddedUnit(string$unit,int$length =2,string$padString ='0',int$padType =STR_PAD_LEFT)

Returns a unit of the instance padded with 0 by default or any other string if specified.

from Date
string
ordinal(string$key,string|null$period =null)

Return a property with its ordinal.

from Date
string
meridiem(bool$isLower =false)

Return the meridiem of the current time in the current locale.

from Date
string
getAltNumber(string$key)

Returns the alternative number for a given date property if available in the current locale.

from Date
string
isoFormat(string$format,string|null$originalFormat =null)

Format in the current language using ISO replacement patterns.

from Date
static array
getFormatsToIsoReplacements()

List of replacements from date() format to isoFormat().

from Date
string
translatedFormat(string$format)

Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) but translate words whenever possible (months, day names, etc.) using the current locale.

from Date
string
getOffsetString(string$separator =':')

Returns the offset hour and minute formatted with +/- and a given separator (":" by default).

from Date
static 
executeStaticCallable($macro,...$parameters)

No description

from Date
static mixed
__callStatic(string$method,array$parameters)

Dynamically handle calls to the class.

from Date
setUnit(string$unit,int$value =null)

Set specified unit to new given value.

from Date
static string
singularUnit(string$unit)

Returns standardized singular of a given singular/plural unit name (in English).

from Date
static string
pluralUnit(string$unit)

Returns standardized plural of a given singular/plural unit name (in English).

from Date
executeCallable($macro,...$parameters)

No description

from Date
executeCallableWithContext($macro,...$parameters)

No description

from Date
static 
getGenericMacros()

No description

from Date
mixed
__call(string$method,array$parameters)

Dynamically handle calls to the class.

from Date
bool
isUtc()

Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)

bool
isLocal()

Check if the current instance has non-UTC timezone.

bool
isValid()

Check if the current instance is a valid date.

bool
isDST()

Check if the current instance is in a daylight saving time.

bool
isSunday()

Checks if the instance day is sunday.

bool
isMonday()

Checks if the instance day is monday.

bool
isTuesday()

Checks if the instance day is tuesday.

bool
isWednesday()

Checks if the instance day is wednesday.

bool
isThursday()

Checks if the instance day is thursday.

bool
isFriday()

Checks if the instance day is friday.

bool
isSaturday()

Checks if the instance day is saturday.

bool
isSameYear(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentYear()

Checks if the instance is in the same year as the current moment.

bool
isNextYear()

Checks if the instance is in the same year as the current moment next year.

bool
isLastYear()

Checks if the instance is in the same year as the current moment last year.

bool
isSameWeek(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentWeek()

Checks if the instance is in the same week as the current moment.

bool
isNextWeek()

Checks if the instance is in the same week as the current moment next week.

bool
isLastWeek()

Checks if the instance is in the same week as the current moment last week.

bool
isSameDay(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentDay()

Checks if the instance is in the same day as the current moment.

bool
isNextDay()

Checks if the instance is in the same day as the current moment next day.

bool
isLastDay()

Checks if the instance is in the same day as the current moment last day.

bool
isSameHour(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentHour()

Checks if the instance is in the same hour as the current moment.

bool
isNextHour()

Checks if the instance is in the same hour as the current moment next hour.

bool
isLastHour()

Checks if the instance is in the same hour as the current moment last hour.

bool
isSameMinute(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentMinute()

Checks if the instance is in the same minute as the current moment.

bool
isNextMinute()

Checks if the instance is in the same minute as the current moment next minute.

bool
isLastMinute()

Checks if the instance is in the same minute as the current moment last minute.

bool
isSameSecond(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentSecond()

Checks if the instance is in the same second as the current moment.

bool
isNextSecond()

Checks if the instance is in the same second as the current moment next second.

bool
isLastSecond()

Checks if the instance is in the same second as the current moment last second.

bool
isSameMicro(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentMicro()

Checks if the instance is in the same microsecond as the current moment.

bool
isNextMicro()

Checks if the instance is in the same microsecond as the current moment next microsecond.

bool
isLastMicro()

Checks if the instance is in the same microsecond as the current moment last microsecond.

bool
isSameMicrosecond(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentMicrosecond()

Checks if the instance is in the same microsecond as the current moment.

bool
isNextMicrosecond()

Checks if the instance is in the same microsecond as the current moment next microsecond.

bool
isLastMicrosecond()

Checks if the instance is in the same microsecond as the current moment last microsecond.

bool
isCurrentMonth()

Checks if the instance is in the same month as the current moment.

bool
isNextMonth()

Checks if the instance is in the same month as the current moment next month.

bool
isLastMonth()

Checks if the instance is in the same month as the current moment last month.

bool
isCurrentQuarter()

Checks if the instance is in the same quarter as the current moment.

bool
isNextQuarter()

Checks if the instance is in the same quarter as the current moment next quarter.

bool
isLastQuarter()

Checks if the instance is in the same quarter as the current moment last quarter.

bool
isSameDecade(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentDecade()

Checks if the instance is in the same decade as the current moment.

bool
isNextDecade()

Checks if the instance is in the same decade as the current moment next decade.

bool
isLastDecade()

Checks if the instance is in the same decade as the current moment last decade.

bool
isSameCentury(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentCentury()

Checks if the instance is in the same century as the current moment.

bool
isNextCentury()

Checks if the instance is in the same century as the current moment next century.

bool
isLastCentury()

Checks if the instance is in the same century as the current moment last century.

bool
isSameMillennium(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).

bool
isCurrentMillennium()

Checks if the instance is in the same millennium as the current moment.

bool
isNextMillennium()

Checks if the instance is in the same millennium as the current moment next millennium.

bool
isLastMillennium()

Checks if the instance is in the same millennium as the current moment last millennium.

CarbonInterface
years(int $value)

Set current instance year to the given value.

from Date
CarbonInterface
setYears(int $value)

Set current instance year to the given value.

from Date
CarbonInterface
setYear(int $value)

Set current instance year to the given value.

from Date
CarbonInterface
months(int $value)

Set current instance month to the given value.

from Date
CarbonInterface
month(int $value)

Set current instance month to the given value.

from Date
CarbonInterface
setMonths(int $value)

Set current instance month to the given value.

from Date
CarbonInterface
setMonth(int $value)

Set current instance month to the given value.

from Date
CarbonInterface
days(int $value)

Set current instance day to the given value.

from Date
CarbonInterface
day(int $value)

Set current instance day to the given value.

from Date
CarbonInterface
setDays(int $value)

Set current instance day to the given value.

from Date
CarbonInterface
setDay(int $value)

Set current instance day to the given value.

from Date
CarbonInterface
hours(int $value)

Set current instance hour to the given value.

from Date
CarbonInterface
hour(int $value)

Set current instance hour to the given value.

from Date
CarbonInterface
setHours(int $value)

Set current instance hour to the given value.

from Date
CarbonInterface
setHour(int $value)

Set current instance hour to the given value.

from Date
CarbonInterface
minutes(int $value)

Set current instance minute to the given value.

from Date
CarbonInterface
minute(int $value)

Set current instance minute to the given value.

from Date
CarbonInterface
setMinutes(int $value)

Set current instance minute to the given value.

from Date
CarbonInterface
setMinute(int $value)

Set current instance minute to the given value.

from Date
CarbonInterface
seconds(int $value)

Set current instance second to the given value.

from Date
CarbonInterface
second(int $value)

Set current instance second to the given value.

from Date
CarbonInterface
setSeconds(int $value)

Set current instance second to the given value.

from Date
CarbonInterface
setSecond(int $value)

Set current instance second to the given value.

from Date
CarbonInterface
millis(int $value)

Set current instance millisecond to the given value.

from Date
CarbonInterface
milli(int $value)

Set current instance millisecond to the given value.

from Date
CarbonInterface
setMillis(int $value)

Set current instance millisecond to the given value.

from Date
CarbonInterface
setMilli(int $value)

Set current instance millisecond to the given value.

from Date
CarbonInterface
milliseconds(int $value)

Set current instance millisecond to the given value.

from Date
CarbonInterface
millisecond(int $value)

Set current instance millisecond to the given value.

from Date
CarbonInterface
setMilliseconds(int $value)

Set current instance millisecond to the given value.

from Date
CarbonInterface
setMillisecond(int $value)

Set current instance millisecond to the given value.

from Date
CarbonInterface
micros(int $value)

Set current instance microsecond to the given value.

from Date
CarbonInterface
micro(int $value)

Set current instance microsecond to the given value.

from Date
CarbonInterface
setMicros(int $value)

Set current instance microsecond to the given value.

from Date
CarbonInterface
setMicro(int $value)

Set current instance microsecond to the given value.

from Date
CarbonInterface
microseconds(int $value)

Set current instance microsecond to the given value.

from Date
CarbonInterface
microsecond(int $value)

Set current instance microsecond to the given value.

from Date
CarbonInterface
setMicroseconds(int $value)

Set current instance microsecond to the given value.

from Date
CarbonInterface
setMicrosecond(int $value)

Set current instance microsecond to the given value.

from Date
CarbonInterface
addYears(int $value =1)

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

from Date
CarbonInterface
addYear()

Add one year to the instance (using date interval).

from Date
CarbonInterface
subYears(int $value =1)

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

from Date
CarbonInterface
subYear()

Sub one year to the instance (using date interval).

from Date
CarbonInterface
addYearsWithOverflow(int $value =1)

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

from Date
CarbonInterface
addYearWithOverflow()

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

from Date
CarbonInterface
subYearsWithOverflow(int $value =1)

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

from Date
CarbonInterface
subYearWithOverflow()

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

from Date
CarbonInterface
addYearsWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
addYearWithoutOverflow()

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

from Date
CarbonInterface
subYearsWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
subYearWithoutOverflow()

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

from Date
CarbonInterface
addYearsWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
addYearWithNoOverflow()

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

from Date
CarbonInterface
subYearsWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
subYearWithNoOverflow()

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

from Date
CarbonInterface
addYearsNoOverflow(int $value =1)

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

from Date
CarbonInterface
addYearNoOverflow()

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

from Date
CarbonInterface
subYearsNoOverflow(int $value =1)

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

from Date
CarbonInterface
subYearNoOverflow()

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

from Date
CarbonInterface
addMonths(int $value =1)

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

from Date
CarbonInterface
addMonth()

Add one month to the instance (using date interval).

from Date
CarbonInterface
subMonths(int $value =1)

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

from Date
CarbonInterface
subMonth()

Sub one month to the instance (using date interval).

from Date
CarbonInterface
addMonthsWithOverflow(int $value =1)

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

from Date
CarbonInterface
addMonthWithOverflow()

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

from Date
CarbonInterface
subMonthsWithOverflow(int $value =1)

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

from Date
CarbonInterface
subMonthWithOverflow()

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

from Date
CarbonInterface
addMonthsWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
addMonthWithoutOverflow()

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

from Date
CarbonInterface
subMonthsWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
subMonthWithoutOverflow()

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

from Date
CarbonInterface
addMonthsWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
addMonthWithNoOverflow()

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

from Date
CarbonInterface
subMonthsWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
subMonthWithNoOverflow()

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

from Date
CarbonInterface
addMonthsNoOverflow(int $value =1)

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

from Date
CarbonInterface
addMonthNoOverflow()

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

from Date
CarbonInterface
subMonthsNoOverflow(int $value =1)

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

from Date
CarbonInterface
subMonthNoOverflow()

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

from Date
CarbonInterface
addDays(int $value =1)

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

from Date
CarbonInterface
addDay()

Add one day to the instance (using date interval).

from Date
CarbonInterface
subDays(int $value =1)

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

from Date
CarbonInterface
subDay()

Sub one day to the instance (using date interval).

from Date
CarbonInterface
addHours(int $value =1)

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

from Date
CarbonInterface
addHour()

Add one hour to the instance (using date interval).

from Date
CarbonInterface
subHours(int $value =1)

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

from Date
CarbonInterface
subHour()

Sub one hour to the instance (using date interval).

from Date
CarbonInterface
addMinutes(int $value =1)

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

from Date
CarbonInterface
addMinute()

Add one minute to the instance (using date interval).

from Date
CarbonInterface
subMinutes(int $value =1)

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

from Date
CarbonInterface
subMinute()

Sub one minute to the instance (using date interval).

from Date
CarbonInterface
addSeconds(int $value =1)

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

from Date
CarbonInterface
addSecond()

Add one second to the instance (using date interval).

from Date
CarbonInterface
subSeconds(int $value =1)

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

from Date
CarbonInterface
subSecond()

Sub one second to the instance (using date interval).

from Date
CarbonInterface
addMillis(int $value =1)

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

from Date
CarbonInterface
addMilli()

Add one millisecond to the instance (using date interval).

from Date
CarbonInterface
subMillis(int $value =1)

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

from Date
CarbonInterface
subMilli()

Sub one millisecond to the instance (using date interval).

from Date
CarbonInterface
addMilliseconds(int $value =1)

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

from Date
CarbonInterface
addMillisecond()

Add one millisecond to the instance (using date interval).

from Date
CarbonInterface
subMilliseconds(int $value =1)

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

from Date
CarbonInterface
subMillisecond()

Sub one millisecond to the instance (using date interval).

from Date
CarbonInterface
addMicros(int $value =1)

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

from Date
CarbonInterface
addMicro()

Add one microsecond to the instance (using date interval).

from Date
CarbonInterface
subMicros(int $value =1)

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

from Date
CarbonInterface
subMicro()

Sub one microsecond to the instance (using date interval).

from Date
CarbonInterface
addMicroseconds(int $value =1)

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

from Date
CarbonInterface
addMicrosecond()

Add one microsecond to the instance (using date interval).

from Date
CarbonInterface
subMicroseconds(int $value =1)

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

from Date
CarbonInterface
subMicrosecond()

Sub one microsecond to the instance (using date interval).

from Date
CarbonInterface
addMillennia(int $value =1)

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

from Date
CarbonInterface
addMillennium()

Add one millennium to the instance (using date interval).

from Date
CarbonInterface
subMillennia(int $value =1)

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

from Date
CarbonInterface
subMillennium()

Sub one millennium to the instance (using date interval).

from Date
CarbonInterface
addMillenniaWithOverflow(int $value =1)

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

from Date
CarbonInterface
addMillenniumWithOverflow()

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

from Date
CarbonInterface
subMillenniaWithOverflow(int $value =1)

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

from Date
CarbonInterface
subMillenniumWithOverflow()

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

from Date
CarbonInterface
addMillenniaWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
addMillenniumWithoutOverflow()

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

from Date
CarbonInterface
subMillenniaWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
subMillenniumWithoutOverflow()

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

from Date
CarbonInterface
addMillenniaWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
addMillenniumWithNoOverflow()

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

from Date
CarbonInterface
subMillenniaWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
subMillenniumWithNoOverflow()

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

from Date
CarbonInterface
addMillenniaNoOverflow(int $value =1)

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

from Date
CarbonInterface
addMillenniumNoOverflow()

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

from Date
CarbonInterface
subMillenniaNoOverflow(int $value =1)

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

from Date
CarbonInterface
subMillenniumNoOverflow()

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

from Date
CarbonInterface
addCenturies(int $value =1)

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

from Date
CarbonInterface
addCentury()

Add one century to the instance (using date interval).

from Date
CarbonInterface
subCenturies(int $value =1)

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

from Date
CarbonInterface
subCentury()

Sub one century to the instance (using date interval).

from Date
CarbonInterface
addCenturiesWithOverflow(int $value =1)

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

from Date
CarbonInterface
addCenturyWithOverflow()

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

from Date
CarbonInterface
subCenturiesWithOverflow(int $value =1)

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

from Date
CarbonInterface
subCenturyWithOverflow()

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

from Date
CarbonInterface
addCenturiesWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
addCenturyWithoutOverflow()

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

from Date
CarbonInterface
subCenturiesWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
subCenturyWithoutOverflow()

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

from Date
CarbonInterface
addCenturiesWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
addCenturyWithNoOverflow()

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

from Date
CarbonInterface
subCenturiesWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
subCenturyWithNoOverflow()

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

from Date
CarbonInterface
addCenturiesNoOverflow(int $value =1)

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

from Date
CarbonInterface
addCenturyNoOverflow()

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

from Date
CarbonInterface
subCenturiesNoOverflow(int $value =1)

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

from Date
CarbonInterface
subCenturyNoOverflow()

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

from Date
CarbonInterface
addDecades(int $value =1)

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

from Date
CarbonInterface
addDecade()

Add one decade to the instance (using date interval).

from Date
CarbonInterface
subDecades(int $value =1)

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

from Date
CarbonInterface
subDecade()

Sub one decade to the instance (using date interval).

from Date
CarbonInterface
addDecadesWithOverflow(int $value =1)

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

from Date
CarbonInterface
addDecadeWithOverflow()

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

from Date
CarbonInterface
subDecadesWithOverflow(int $value =1)

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

from Date
CarbonInterface
subDecadeWithOverflow()

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

from Date
CarbonInterface
addDecadesWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
addDecadeWithoutOverflow()

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

from Date
CarbonInterface
subDecadesWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
subDecadeWithoutOverflow()

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

from Date
CarbonInterface
addDecadesWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
addDecadeWithNoOverflow()

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

from Date
CarbonInterface
subDecadesWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
subDecadeWithNoOverflow()

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

from Date
CarbonInterface
addDecadesNoOverflow(int $value =1)

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

from Date
CarbonInterface
addDecadeNoOverflow()

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

from Date
CarbonInterface
subDecadesNoOverflow(int $value =1)

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

from Date
CarbonInterface
subDecadeNoOverflow()

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

from Date
CarbonInterface
addQuarters(int $value =1)

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

from Date
CarbonInterface
addQuarter()

Add one quarter to the instance (using date interval).

from Date
CarbonInterface
subQuarters(int $value =1)

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

from Date
CarbonInterface
subQuarter()

Sub one quarter to the instance (using date interval).

from Date
CarbonInterface
addQuartersWithOverflow(int $value =1)

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

from Date
CarbonInterface
addQuarterWithOverflow()

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

from Date
CarbonInterface
subQuartersWithOverflow(int $value =1)

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

from Date
CarbonInterface
subQuarterWithOverflow()

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

from Date
CarbonInterface
addQuartersWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
addQuarterWithoutOverflow()

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

from Date
CarbonInterface
subQuartersWithoutOverflow(int $value =1)

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

from Date
CarbonInterface
subQuarterWithoutOverflow()

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

from Date
CarbonInterface
addQuartersWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
addQuarterWithNoOverflow()

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

from Date
CarbonInterface
subQuartersWithNoOverflow(int $value =1)

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

from Date
CarbonInterface
subQuarterWithNoOverflow()

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

from Date
CarbonInterface
addQuartersNoOverflow(int $value =1)

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

from Date
CarbonInterface
addQuarterNoOverflow()

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

from Date
CarbonInterface
subQuartersNoOverflow(int $value =1)

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

from Date
CarbonInterface
subQuarterNoOverflow()

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

from Date
CarbonInterface
addWeek()

Add one week to the instance (using date interval).

from Date
CarbonInterface
subWeek()

Sub one week to the instance (using date interval).

from Date
CarbonInterface
addWeekdays(int $value =1)

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

from Date
CarbonInterface
addWeekday()

Add one weekday to the instance (using date interval).

from Date
CarbonInterface
subWeekdays(int $value =1)

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

from Date
CarbonInterface
subWeekday()

Sub one weekday to the instance (using date interval).

from Date
CarbonInterface
addRealMicros(int $value =1)

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

from Date
CarbonInterface
addRealMicro()

Add one microsecond to the instance (using timestamp).

from Date
CarbonInterface
subRealMicros(int $value =1)

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

from Date
CarbonInterface
subRealMicro()

Sub one microsecond to the instance (using timestamp).

from Date
CarbonPeriod
microsUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealMicroseconds(int $value =1)

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

from Date
CarbonInterface
addRealMicrosecond()

Add one microsecond to the instance (using timestamp).

from Date
CarbonInterface
subRealMicroseconds(int $value =1)

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

from Date
CarbonInterface
subRealMicrosecond()

Sub one microsecond to the instance (using timestamp).

from Date
CarbonPeriod
microsecondsUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealMillis(int $value =1)

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

from Date
CarbonInterface
addRealMilli()

Add one millisecond to the instance (using timestamp).

from Date
CarbonInterface
subRealMillis(int $value =1)

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

from Date
CarbonInterface
subRealMilli()

Sub one millisecond to the instance (using timestamp).

from Date
CarbonPeriod
millisUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealMilliseconds(int $value =1)

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

from Date
CarbonInterface
addRealMillisecond()

Add one millisecond to the instance (using timestamp).

from Date
CarbonInterface
subRealMilliseconds(int $value =1)

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

from Date
CarbonInterface
subRealMillisecond()

Sub one millisecond to the instance (using timestamp).

from Date
CarbonPeriod
millisecondsUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealSeconds(int $value =1)

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

from Date
CarbonInterface
addRealSecond()

Add one second to the instance (using timestamp).

from Date
CarbonInterface
subRealSeconds(int $value =1)

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

from Date
CarbonInterface
subRealSecond()

Sub one second to the instance (using timestamp).

from Date
CarbonPeriod
secondsUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealMinutes(int $value =1)

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

from Date
CarbonInterface
addRealMinute()

Add one minute to the instance (using timestamp).

from Date
CarbonInterface
subRealMinutes(int $value =1)

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

from Date
CarbonInterface
subRealMinute()

Sub one minute to the instance (using timestamp).

from Date
CarbonPeriod
minutesUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealHours(int $value =1)

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

from Date
CarbonInterface
addRealHour()

Add one hour to the instance (using timestamp).

from Date
CarbonInterface
subRealHours(int $value =1)

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

from Date
CarbonInterface
subRealHour()

Sub one hour to the instance (using timestamp).

from Date
CarbonPeriod
hoursUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealDays(int $value =1)

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

from Date
CarbonInterface
addRealDay()

Add one day to the instance (using timestamp).

from Date
CarbonInterface
subRealDays(int $value =1)

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

from Date
CarbonInterface
subRealDay()

Sub one day to the instance (using timestamp).

from Date
CarbonPeriod
daysUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealWeeks(int $value =1)

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

from Date
CarbonInterface
addRealWeek()

Add one week to the instance (using timestamp).

from Date
CarbonInterface
subRealWeeks(int $value =1)

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

from Date
CarbonInterface
subRealWeek()

Sub one week to the instance (using timestamp).

from Date
CarbonPeriod
weeksUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealMonths(int $value =1)

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

from Date
CarbonInterface
addRealMonth()

Add one month to the instance (using timestamp).

from Date
CarbonInterface
subRealMonths(int $value =1)

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

from Date
CarbonInterface
subRealMonth()

Sub one month to the instance (using timestamp).

from Date
CarbonPeriod
monthsUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealQuarters(int $value =1)

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

from Date
CarbonInterface
addRealQuarter()

Add one quarter to the instance (using timestamp).

from Date
CarbonInterface
subRealQuarters(int $value =1)

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

from Date
CarbonInterface
subRealQuarter()

Sub one quarter to the instance (using timestamp).

from Date
CarbonPeriod
quartersUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealYears(int $value =1)

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

from Date
CarbonInterface
addRealYear()

Add one year to the instance (using timestamp).

from Date
CarbonInterface
subRealYears(int $value =1)

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

from Date
CarbonInterface
subRealYear()

Sub one year to the instance (using timestamp).

from Date
CarbonPeriod
yearsUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealDecades(int $value =1)

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

from Date
CarbonInterface
addRealDecade()

Add one decade to the instance (using timestamp).

from Date
CarbonInterface
subRealDecades(int $value =1)

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

from Date
CarbonInterface
subRealDecade()

Sub one decade to the instance (using timestamp).

from Date
CarbonPeriod
decadesUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealCenturies(int $value =1)

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

from Date
CarbonInterface
addRealCentury()

Add one century to the instance (using timestamp).

from Date
CarbonInterface
subRealCenturies(int $value =1)

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

from Date
CarbonInterface
subRealCentury()

Sub one century to the instance (using timestamp).

from Date
CarbonPeriod
centuriesUntil($endDate =null,int $factor =1)

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.

CarbonInterface
addRealMillennia(int $value =1)

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

from Date
CarbonInterface
addRealMillennium()

Add one millennium to the instance (using timestamp).

from Date
CarbonInterface
subRealMillennia(int $value =1)

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

from Date
CarbonInterface
subRealMillennium()

Sub one millennium to the instance (using timestamp).

from Date
CarbonPeriod
millenniaUntil($endDate =null,int $factor =1)

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.

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

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

from Date
CarbonInterface
roundYears(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorYear(float $precision =1)

Truncate the current instance year with given precision.

from Date
CarbonInterface
floorYears(float $precision =1)

Truncate the current instance year with given precision.

from Date
CarbonInterface
ceilYear(float $precision =1)

Ceil the current instance year with given precision.

from Date
CarbonInterface
ceilYears(float $precision =1)

Ceil the current instance year with given precision.

from Date
CarbonInterface
roundMonth(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundMonths(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorMonth(float $precision =1)

Truncate the current instance month with given precision.

from Date
CarbonInterface
floorMonths(float $precision =1)

Truncate the current instance month with given precision.

from Date
CarbonInterface
ceilMonth(float $precision =1)

Ceil the current instance month with given precision.

from Date
CarbonInterface
ceilMonths(float $precision =1)

Ceil the current instance month with given precision.

from Date
CarbonInterface
roundDay(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundDays(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorDay(float $precision =1)

Truncate the current instance day with given precision.

from Date
CarbonInterface
floorDays(float $precision =1)

Truncate the current instance day with given precision.

from Date
CarbonInterface
ceilDay(float $precision =1)

Ceil the current instance day with given precision.

from Date
CarbonInterface
ceilDays(float $precision =1)

Ceil the current instance day with given precision.

from Date
CarbonInterface
roundHour(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundHours(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorHour(float $precision =1)

Truncate the current instance hour with given precision.

from Date
CarbonInterface
floorHours(float $precision =1)

Truncate the current instance hour with given precision.

from Date
CarbonInterface
ceilHour(float $precision =1)

Ceil the current instance hour with given precision.

from Date
CarbonInterface
ceilHours(float $precision =1)

Ceil the current instance hour with given precision.

from Date
CarbonInterface
roundMinute(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundMinutes(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorMinute(float $precision =1)

Truncate the current instance minute with given precision.

from Date
CarbonInterface
floorMinutes(float $precision =1)

Truncate the current instance minute with given precision.

from Date
CarbonInterface
ceilMinute(float $precision =1)

Ceil the current instance minute with given precision.

from Date
CarbonInterface
ceilMinutes(float $precision =1)

Ceil the current instance minute with given precision.

from Date
CarbonInterface
roundSecond(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundSeconds(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorSecond(float $precision =1)

Truncate the current instance second with given precision.

from Date
CarbonInterface
floorSeconds(float $precision =1)

Truncate the current instance second with given precision.

from Date
CarbonInterface
ceilSecond(float $precision =1)

Ceil the current instance second with given precision.

from Date
CarbonInterface
ceilSeconds(float $precision =1)

Ceil the current instance second with given precision.

from Date
CarbonInterface
roundMillennium(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundMillennia(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorMillennium(float $precision =1)

Truncate the current instance millennium with given precision.

from Date
CarbonInterface
floorMillennia(float $precision =1)

Truncate the current instance millennium with given precision.

from Date
CarbonInterface
ceilMillennium(float $precision =1)

Ceil the current instance millennium with given precision.

from Date
CarbonInterface
ceilMillennia(float $precision =1)

Ceil the current instance millennium with given precision.

from Date
CarbonInterface
roundCentury(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundCenturies(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorCentury(float $precision =1)

Truncate the current instance century with given precision.

from Date
CarbonInterface
floorCenturies(float $precision =1)

Truncate the current instance century with given precision.

from Date
CarbonInterface
ceilCentury(float $precision =1)

Ceil the current instance century with given precision.

from Date
CarbonInterface
ceilCenturies(float $precision =1)

Ceil the current instance century with given precision.

from Date
CarbonInterface
roundDecade(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundDecades(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorDecade(float $precision =1)

Truncate the current instance decade with given precision.

from Date
CarbonInterface
floorDecades(float $precision =1)

Truncate the current instance decade with given precision.

from Date
CarbonInterface
ceilDecade(float $precision =1)

Ceil the current instance decade with given precision.

from Date
CarbonInterface
ceilDecades(float $precision =1)

Ceil the current instance decade with given precision.

from Date
CarbonInterface
roundQuarter(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundQuarters(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorQuarter(float $precision =1)

Truncate the current instance quarter with given precision.

from Date
CarbonInterface
floorQuarters(float $precision =1)

Truncate the current instance quarter with given precision.

from Date
CarbonInterface
ceilQuarter(float $precision =1)

Ceil the current instance quarter with given precision.

from Date
CarbonInterface
ceilQuarters(float $precision =1)

Ceil the current instance quarter with given precision.

from Date
CarbonInterface
roundMillisecond(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundMilliseconds(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorMillisecond(float $precision =1)

Truncate the current instance millisecond with given precision.

from Date
CarbonInterface
floorMilliseconds(float $precision =1)

Truncate the current instance millisecond with given precision.

from Date
CarbonInterface
ceilMillisecond(float $precision =1)

Ceil the current instance millisecond with given precision.

from Date
CarbonInterface
ceilMilliseconds(float $precision =1)

Ceil the current instance millisecond with given precision.

from Date
CarbonInterface
roundMicrosecond(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
roundMicroseconds(float $precision =1,string $function ="round")

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

from Date
CarbonInterface
floorMicrosecond(float $precision =1)

Truncate the current instance microsecond with given precision.

from Date
CarbonInterface
floorMicroseconds(float $precision =1)

Truncate the current instance microsecond with given precision.

from Date
CarbonInterface
ceilMicrosecond(float $precision =1)

Ceil the current instance microsecond with given precision.

from Date
CarbonInterface
ceilMicroseconds(float $precision =1)

Ceil the current instance microsecond with given precision.

from Date
string
shortAbsoluteDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

string
longAbsoluteDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

string
shortRelativeDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

string
longRelativeDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

string
shortRelativeToNowDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

string
longRelativeToNowDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

string
shortRelativeToOtherDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

string
longRelativeToOtherDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Details

inBoundariesat line46
Boundaries startOfDay()

Resets the time to 00:00:00 start of day

Return Value

Boundaries

inBoundariesat line61
Boundaries endOfDay()

Resets the time to 23:59:59.999999 end of day

Return Value

Boundaries

inBoundariesat line76
Boundaries startOfMonth()

Resets the date to the first day of the month and the time to 00:00:00

Return Value

Boundaries

inBoundariesat line91
Boundaries endOfMonth()

Resets the date to end of the month and time to 23:59:59.999999

Return Value

Boundaries

inBoundariesat line106
Boundaries startOfQuarter()

Resets the date to the first day of the quarter and the time to 00:00:00

Return Value

Boundaries

inBoundariesat line123
Boundaries endOfQuarter()

Resets the date to end of the quarter and time to 23:59:59.999999

Return Value

Boundaries

inBoundariesat line138
Boundaries startOfYear()

Resets the date to the first day of the year and the time to 00:00:00

Return Value

Boundaries

inBoundariesat line153
Boundaries endOfYear()

Resets the date to end of the year and time to 23:59:59.999999

Return Value

Boundaries

inBoundariesat line168
Boundaries startOfDecade()

Resets the date to the first day of the decade and the time to 00:00:00

Return Value

Boundaries

inBoundariesat line185
Boundaries endOfDecade()

Resets the date to end of the decade and time to 23:59:59.999999

Return Value

Boundaries

inBoundariesat line202
Boundaries startOfCentury()

Resets the date to the first day of the century and the time to 00:00:00

Return Value

Boundaries

inBoundariesat line219
Boundaries endOfCentury()

Resets the date to end of the century and time to 23:59:59.999999

Return Value

Boundaries

inBoundariesat line236
Boundaries startOfMillennium()

Resets the date to the first day of the millennium and the time to 00:00:00

Return Value

Boundaries

inBoundariesat line253
Boundaries endOfMillennium()

Resets the date to end of the millennium and time to 23:59:59.999999

Return Value

Boundaries

inWeekat line37
static startOfWeek(int $day =1)

Parameters

int $day

Return Value

static

inBoundariesat line293
Boundaries endOfWeek(int$weekEndsAt =null)

Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999

Parameters

int $weekEndsAt optional start allow you to specify the day of week to use to end the week

Return Value

Boundaries

inBoundariesat line308
Boundaries startOfHour()

Modify to start of current hour, minutes and seconds become 0

Return Value

Boundaries

inBoundariesat line323
Boundaries endOfHour()

Modify to end of current hour, minutes and seconds become 59

Return Value

Boundaries

inBoundariesat line338
Boundaries startOfMinute()

Modify to start of current minute, seconds become 0

Return Value

Boundaries

inBoundariesat line353
Boundaries endOfMinute()

Modify to end of current minute, seconds become 59

Return Value

Boundaries

inBoundariesat line370
Boundaries startOfSecond()

Modify to start of current second, microseconds become 0

Return Value

Boundaries

inBoundariesat line387
Boundaries endOfSecond()

Modify to end of current second, microseconds become 999999

Return Value

Boundaries

inBoundariesat line407
Boundaries startOf(string$unit,array...$params)

Modify to start of current given unit.

Parameters

string $unit
array ...$params mixed> $params

Return Value

Boundaries

inBoundariesat line433
Boundaries endOf(string$unit,array...$params)

Modify to end of current given unit.

Parameters

string $unit
array ...$params mixed> $params

Return Value

Boundaries

inComparisonat line57
bool eq(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is equal to another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

See also

equalTo()

inComparisonat line76
bool equalTo(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is equal to another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

inComparisonat line100
bool ne(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is not equal to another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

See also

notEqualTo()

inComparisonat line119
bool notEqualTo(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is not equal to another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

inComparisonat line140
bool gt(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

See also

greaterThan()

inComparisonat line159
bool greaterThan(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

inComparisonat line183
bool isAfter(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

See also

greaterThan()

inComparisonat line204
bool gte(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than or equal to another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

See also

greaterThanOrEqualTo()

inComparisonat line223
bool greaterThanOrEqualTo(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is greater (after) than or equal to another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

inComparisonat line247
bool lt(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is less (before) than another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

See also

lessThan()

inDifferenceat line35
bool lessThan($date)

Parameters

$date

Return Value

bool

inComparisonat line290
bool isBefore(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is less (before) than another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

See also

lessThan()

inComparisonat line311
bool lte(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is less (before) or equal to another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

See also

lessThanOrEqualTo()

inComparisonat line330
bool lessThanOrEqualTo(Carbon|DateTimeInterface|mixed$date)

Determines if the instance is less (before) or equal to another

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

bool

inComparisonat line359
bool between(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2,bool$equal =true)

Determines if the instance is between two others.

The third argument allow you to specify if bounds are included or not (true by default) but for when you including/excluding bounds may produce different results in your application, we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead.

Parameters

Carbon|DateTimeInterface|mixed $date1
Carbon|DateTimeInterface|mixed $date2
bool $equal Indicates if an equal to comparison should be done

Return Value

bool

inComparisonat line390
bool betweenIncluded(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)

Determines if the instance is between two others, bounds included.

Parameters

Carbon|DateTimeInterface|mixed $date1
Carbon|DateTimeInterface|mixed $date2

Return Value

bool

inComparisonat line410
bool betweenExcluded(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)

Determines if the instance is between two others, bounds excluded.

Parameters

Carbon|DateTimeInterface|mixed $date1
Carbon|DateTimeInterface|mixed $date2

Return Value

bool

inComparisonat line432
bool isBetween(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2,bool$equal =true)

Determines if the instance is between two others

Parameters

Carbon|DateTimeInterface|mixed $date1
Carbon|DateTimeInterface|mixed $date2
bool $equal Indicates if an equal to comparison should be done

Return Value

bool

inComparisonat line448
bool isWeekday()

Determines if the instance is a weekday.

Return Value

bool

inComparisonat line464
bool isWeekend()

Determines if the instance is a weekend day.

Return Value

bool

inComparisonat line480
bool isYesterday()

Determines if the instance is yesterday.

Return Value

bool

inComparisonat line496
bool isToday()

Determines if the instance is today.

Return Value

bool

inComparisonat line512
bool isTomorrow()

Determines if the instance is tomorrow.

Return Value

bool

inComparisonat line528
bool isFuture()

Determines if the instance is in the future, ie. greater (after) than now.

Return Value

bool

inComparisonat line544
bool isPast()

Determines if the instance is in the past, ie. less (before) than now.

Return Value

bool

inComparisonat line560
bool isLeapYear()

Determines if the instance is a leap year.

Return Value

bool

inComparisonat line578
bool isLongYear()

Determines if the instance is a long year

inComparisonat line597
bool isSameAs(string$format,Carbon|DateTimeInterface|string|null$date =null)

Compares the formatted values of the two dates.

Parameters

string $format date formats to compare.
Carbon|DateTimeInterface|string|null $date instance to compare with or null to use current day.

Return Value

bool

inComparisonat line618
bool isSameUnit(string$unit,Carbon|DateTimeInterface|null$date =null)

Determines if the instance is in the current unit given.

Parameters

string $unit singular unit string
Carbon|DateTimeInterface|null $date instance to compare with or null to use current day.

Return Value

bool

Exceptions

BadComparisonUnitException

inComparisonat line669
bool isCurrentUnit(string$unit)

Determines if the instance is in the current unit given.

Parameters

string $unit The unit to test.

Return Value

bool

Exceptions

BadMethodCallException

inComparisonat line690
bool isSameQuarter(Carbon|DateTimeInterface|string|null$date =null,bool$ofSameYear =true)

Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).

Parameters

Carbon|DateTimeInterface|string|null $date The instance to compare with or null to use current day.
bool $ofSameYear Check if it is the same month in the same year.

Return Value

bool

inComparisonat line713
bool isSameMonth(Carbon|DateTimeInterface|null$date =null,bool$ofSameYear =true)

Checks if the passed in date is in the same month as the instance´s month.

Parameters

Carbon|DateTimeInterface|null $date The instance to compare with or null to use the current date.
bool $ofSameYear Check if it is the same month in the same year.

Return Value

bool

inComparisonat line733
bool isDayOfWeek(int$dayOfWeek)

Checks if this day is a specific day of the week.

Parameters

int $dayOfWeek

Return Value

bool

inComparisonat line757
bool isBirthday(Carbon|DateTimeInterface|null$date =null)

Check if its the birthday. Compares the date/month values of the two dates.

Parameters

Carbon|DateTimeInterface|null $date The instance to compare with or null to use current day.

Return Value

bool

inComparisonat line776
bool isLastOfMonth()

Check if today is the last day of the Month

Return Value

bool

inComparisonat line797
bool isStartOfDay(bool$checkMicroseconds =false)

Check if the instance is start of day / midnight.

Parameters

bool $checkMicroseconds check time at microseconds precision

Return Value

bool

inComparisonat line823
bool isEndOfDay(bool$checkMicroseconds =false)

Check if the instance is end of day.

Parameters

bool $checkMicroseconds check time at microseconds precision

Return Value

bool

inComparisonat line843
bool isMidnight()

Check if the instance is start of day / midnight.

Return Value

bool

inComparisonat line861
bool isMidday()

Check if the instance is midday.

Return Value

bool

inComparisonat line881
staticbool hasFormat(string$date,string$format)

Checks if the (date)time string is in a given format.

Parameters

string $date
string $format

Return Value

bool

inComparisonat line904
staticbool hasFormatWithModifiers(string$date,string$format)

Checks if the (date)time string is in a given format.

Parameters

string $date
string $format

Return Value

bool

inComparisonat line924
staticbool canBeCreatedFromFormat(string$date,string$format)

Checks if the (date)time string is in a given format and valid to create a new instance.

Parameters

string $date
string $format

Return Value

bool

inComparisonat line963
bool is(string$tester)

Returns true if the current date matches the given string.

Parameters

string $tester day name, month name, hour, date, etc. as string

Return Value

bool

inComparisonat line1071
bool isStartOfTime()

Returns true if the date was created using CarbonImmutable::startOfTime()

Return Value

bool

inComparisonat line1081
bool isEndOfTime()

Returns true if the date was created using CarbonImmutable::endOfTime()

Return Value

bool

inDifferenceat line35
static resolveCarbon($date =null)

Parameters

$date

Return Value

static

inWeekat line37
static copy()

Return Value

static

inComparisonat line33
static nowWithSameTz()

Return Value

static

inConverterat line49
staticvoid resetToStringFormat()

Reset the format used to the default when type juggling a Carbon instance to a string

Return Value

void

inConverterat line66
staticvoid setToStringFormat(string|Closure|null$format)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and use other method or custom format passed to format() method if you need to dump an other string format. Set the default format used when type juggling a Carbon instance to a string

Parameters

string|Closure|null $format

Return Value

void

inConverterat line81
format($format)

Parameters

$format

inConverterat line103
string rawFormat(string$format)

Parameters

string $format

Return Value

string

See also

https://php.net/manual/en/datetime.format.php

inConverterat line118
string __toString()

Format the instance as a string using the set format

Return Value

string

inConverterat line141
string toDateString()

Format the instance as date

Return Value

string

inConverterat line156
string toFormattedDateString()

Format the instance as a readable date

Return Value

string

inConverterat line171
string toFormattedDayDateString()

Format the instance with the day, and a readable date

Return Value

string

inConverterat line188
string toTimeString(string$unitPrecision ='second')

Format the instance as time

Parameters

string $unitPrecision

Return Value

string

inConverterat line205
string toDateTimeString(string$unitPrecision ='second')

Format the instance as date and time

Parameters

string $unitPrecision

Return Value

string

inConverterat line217
staticstring getTimeFormatByPrecision(string$unitPrecision)

Return a format from H:i to H:i:s.u according to given unit precision.

Parameters

string $unitPrecision "minute", "second", "millisecond" or "microsecond"

Return Value

string

inConverterat line249
string toDateTimeLocalString(string$unitPrecision ='second')

Format the instance as date and time T-separated with no timezone

Parameters

string $unitPrecision

Return Value

string

inConverterat line264
string toDayDateTimeString()

Format the instance with day, date and time

Return Value

string

inConverterat line279
string toAtomString()

Format the instance as ATOM

Return Value

string

inConverterat line294
string toCookieString()

Format the instance as COOKIE

Return Value

string

inConverterat line309
string toIso8601String()

Format the instance as ISO8601

Return Value

string

inConverterat line324
string toRfc822String()

Format the instance as RFC822

Return Value

string

inConverterat line341
string toIso8601ZuluString(string$unitPrecision ='second')

Convert the instance to UTC and return as Zulu ISO8601

Parameters

string $unitPrecision

Return Value

string

inConverterat line358
string toRfc850String()

Format the instance as RFC850

Return Value

string

inConverterat line373
string toRfc1036String()

Format the instance as RFC1036

Return Value

string

inConverterat line388
string toRfc1123String()

Format the instance as RFC1123

Return Value

string

inConverterat line403
string toRfc2822String()

Format the instance as RFC2822

Return Value

string

inConverterat line421
string toRfc3339String(bool$extended =false)

Format the instance as RFC3339

Parameters

bool $extended

Return Value

string

inConverterat line441
string toRssString()

Format the instance as RSS

Return Value

string

inConverterat line456
string toW3cString()

Format the instance as W3C

Return Value

string

inConverterat line471
string toRfc7231String()

Format the instance as RFC7231

Return Value

string

inConverterat line488
array toArray()

Get default array representation.

Return Value

array

inConverterat line516
object toObject()

Get default object representation.

Return Value

object

inConverterat line531
string toString()

Returns english human readable complete date string.

Return Value

string

inConverterat line550
null|string toISOString(bool$keepOffset =false)

Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: 1977-04-22T01:00:00-05:00).

Parameters

bool $keepOffset Pass true to keep the date offset. Else forced to UTC.

Return Value

null|string

inSerializationat line35
string toJSON()

Return Value

string

inConverterat line588
DateTime toDateTime()

Return native DateTime PHP object matching the current instance.

Return Value

DateTime

inConverterat line603
DateTimeImmutable toDateTimeImmutable()

Return native toDateTimeImmutable PHP object matching the current instance.

Return Value

DateTimeImmutable

inConverterat line620
DateTime toDate()

Return Value

DateTime

inConverterat line634
CarbonPeriod toPeriod(DateTimeInterface|Carbon|CarbonImmutable|int|null$end =null,int|DateInterval|string|null$interval =null,string|null$unit =null)

Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).

Parameters

DateTimeInterface|Carbon|CarbonImmutable|int|null $end period end date or recurrences count if int
int|DateInterval|string|null $interval period default interval or number of the given $unit
string|null $unit if specified, $interval must be an integer

Return Value

CarbonPeriod

inConverterat line664
CarbonPeriod range(DateTimeInterface|Carbon|CarbonImmutable|null$end =null,int|DateInterval|string|null$interval =null,string|null$unit =null)

Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).

Parameters

DateTimeInterface|Carbon|CarbonImmutable|null $end period end date
int|DateInterval|string|null $interval period default interval or number of the given $unit
string|null $unit if specified, $interval must be an integer

Return Value

CarbonPeriod

inCreatorat line58
__construct(DateTimeInterface|string|null$time =null,DateTimeZone|string|null$tz =null)

Create a new Carbon instance.

Please see the testing aids section (specifically static::setTestNow()) for more on the possibility of this constructor returning a test instance.

Parameters

DateTimeInterface|string|null $time
DateTimeZone|string|null $tz

Exceptions

InvalidFormatException

inCreatorat line129
__clone()

Update constructedObjectId on cloned.

inCreatorat line141
staticCreator instance(DateTimeInterface$date)

Create a Carbon instance from a DateTime one.

Parameters

DateTimeInterface $date

Return Value

Creator

inCreatorat line178
staticCreator rawParse(string|DateTimeInterface|null$time =null,DateTimeZone|string|null$tz =null)

Create a carbon instance from a string.

This is an alias for the constructor that allows better fluent syntax as it allows you to do Carbon::parse('Monday next week')->fn() rather than (new Carbon('Monday next week'))->fn().

Parameters

string|DateTimeInterface|null $time
DateTimeZone|string|null $tz

Return Value

Creator

Exceptions

InvalidFormatException

inCreatorat line211
staticCreator parse(string|DateTimeInterface|null$time =null,DateTimeZone|string|null$tz =null)

Create a carbon instance from a string.

This is an alias for the constructor that allows better fluent syntax as it allows you to do Carbon::parse('Monday next week')->fn() rather than (new Carbon('Monday next week'))->fn().

Parameters

string|DateTimeInterface|null $time
DateTimeZone|string|null $tz

Return Value

Creator

Exceptions

InvalidFormatException

inCreatorat line238
staticCreator parseFromLocale(string$time,string|null$locale =null,DateTimeZone|string|null$tz =null)

Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).

Parameters

string $time date/time string in the given language (may also contain English).
string|null $locale if locale is null or not specified, current global locale will be used instead.
DateTimeZone|string|null $tz optional timezone for the new instance.

Return Value

Creator

Exceptions

InvalidFormatException

inCreatorat line250
staticCreator now(DateTimeZone|string|null$tz =null)

Get a Carbon instance for the current date and time.

Parameters

DateTimeZone|string|null $tz

Return Value

Creator

inCreatorat line262
staticCreator today(DateTimeZone|string|null$tz =null)

Create a Carbon instance for today.

Parameters

DateTimeZone|string|null $tz

Return Value

Creator

inCreatorat line274
staticCreator tomorrow(DateTimeZone|string|null$tz =null)

Create a Carbon instance for tomorrow.

Parameters

DateTimeZone|string|null $tz

Return Value

Creator

inCreatorat line286
staticCreator yesterday(DateTimeZone|string|null$tz =null)

Create a Carbon instance for yesterday.

Parameters

DateTimeZone|string|null $tz

Return Value

Creator

inCreatorat line296
staticCreator maxValue()

Create a Carbon instance for the greatest supported date.

Return Value

Creator

inCreatorat line312
staticCreator minValue()

Create a Carbon instance for the lowest supported date.

Return Value

Creator

inCreatorat line369
staticCreator|false create(int|null$year =0,int|null$month =1,int|null$day =1,int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)

Create a new Carbon instance from a specific date and time.

If any of $year, $month or $day are set to null their now() values will be used.

If $hour is null it will be set to its now() value and the default values for $minute and $second will be their now() values.

If $hour is not null then the default values for $minute and $second will be 0.

Parameters

int|null $year
int|null $month
int|null $day
int|null $hour
int|null $minute
int|null $second
DateTimeZone|string|null $tz

Return Value

Creator|false

Exceptions

InvalidFormatException

inCreatorat line453
staticCreator|false createSafe(int|null$year =null,int|null$month =null,int|null$day =null,int|null$hour =null,int|null$minute =null,int|null$second =null,DateTimeZone|string|null$tz =null)

Create a new safe Carbon instance from a specific date and time.

If any of $year, $month or $day are set to null their now() values will be used.

If $hour is null it will be set to its now() value and the default values for $minute and $second will be their now() values.

If $hour is not null then the default values for $minute and $second will be 0.

If one of the set values is not valid, an InvalidDateException will be thrown.

Parameters

int|null $year
int|null $month
int|null $day
int|null $hour
int|null $minute
int|null $second
DateTimeZone|string|null $tz

Return Value

Creator|false

Exceptions

InvalidDateException

inCreatorat line499
staticCreator createStrict(int|null$year =0,int|null$month =1,int|null$day =1,int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)

Create a new Carbon instance from a specific date and time using strict validation.

Parameters

int|null $year
int|null $month
int|null $day
int|null $hour
int|null $minute
int|null $second
DateTimeZone|string|null $tz

Return Value

Creator

Exceptions

InvalidFormatException

See also

create()

inCreatorat line525
staticCreator createFromDate(int|null$year =null,int|null$month =null,int|null$day =null,DateTimeZone|string|null$tz =null)

Create a Carbon instance from just a date. The time portion is set to now.

Parameters

int|null $year
int|null $month
int|null $day
DateTimeZone|string|null $tz

Return Value

Creator

Exceptions

InvalidFormatException

inCreatorat line542
staticCreator createMidnightDate(int|null$year =null,int|null$month =null,int|null$day =null,DateTimeZone|string|null$tz =null)

Create a Carbon instance from just a date. The time portion is set to midnight.

Parameters

int|null $year
int|null $month
int|null $day
DateTimeZone|string|null $tz

Return Value

Creator

Exceptions

InvalidFormatException

inCreatorat line559
staticCreator createFromTime(int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)

Create a Carbon instance from just a time. The date portion is set to today.

Parameters

int|null $hour
int|null $minute
int|null $second
DateTimeZone|string|null $tz

Return Value

Creator

Exceptions

InvalidFormatException

inCreatorat line574
staticCreator createFromTimeString(string$time,DateTimeZone|string|null$tz =null)

Create a Carbon instance from a time string. The date portion is set to today.

Parameters

string $time
DateTimeZone|string|null $tz

Return Value

Creator

Exceptions

InvalidFormatException

inCreatorat line623
staticCreator|false rawCreateFromFormat(string$format,string$time,DateTimeZone|string|false|null$tz =null)

Create a Carbon instance from a specific format.

Parameters

string $format Datetime format
string $time
DateTimeZone|string|false|null $tz

Return Value

Creator|false

Exceptions

InvalidFormatException

inCreatorat line694
static createFromFormat($format,$time,$tz =null)

Parameters

$format
$time
$tz

inCreatorat line722
staticCreator|false createFromIsoFormat(string$format,string$time,DateTimeZone|string|false|null$tz =null,string|null$locale ='en',TranslatorInterface$translator =null)

Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).

Parameters

string $format Datetime format
string $time
DateTimeZone|string|false|null $tz optional timezone
string|null $locale locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use)
TranslatorInterface $translator optional custom translator to use for macro-formats

Return Value

Creator|false

Exceptions

InvalidFormatException

inCreatorat line863
staticCreator|false createFromLocaleFormat(string$format,string$locale,string$time,DateTimeZone|string|false|null$tz =null)

Create a Carbon instance from a specific format and a string in a given language.

Parameters

string $format Datetime format
string $locale
string $time
DateTimeZone|string|false|null $tz

Return Value

Creator|false

Exceptions

InvalidFormatException

inCreatorat line880
staticCreator|false createFromLocaleIsoFormat(string$format,string$locale,string$time,DateTimeZone|string|false|null$tz =null)

Create a Carbon instance from a specific ISO format and a string in a given language.

Parameters

string $format Datetime ISO format
string $locale
string $time
DateTimeZone|string|false|null $tz

Return Value

Creator|false

Exceptions

InvalidFormatException

inCreatorat line899
staticCreator|null make(mixed$var)

Make a Carbon instance from given variable if possible.

Always return a new instance. Parse only strings and only these likely to be dates (skip intervals and recurrences). Throw an exception for invalid format, but otherwise return null.

Parameters

mixed $var

Return Value

Creator|null

Exceptions

InvalidFormatException

inCreatorat line939
static getLastErrors()

inDifferenceat line42
staticprotected fixNegativeMicroseconds(CarbonInterval$diff)

Parameters

CarbonInterval $diff

inDifferenceat line86
staticprotectedCarbonInterval fixDiffInterval(DateInterval$diff,bool$absolute)

Parameters

DateInterval $diff
bool $absolute

Return Value

CarbonInterval

inDifferenceat line124
diff($date =null,$absolute =false)

Parameters

$date
$absolute

inDifferenceat line151
CarbonInterval diffAsCarbonInterval(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference as a CarbonInterval instance.

Return relative interval (negative if $absolute flag is not set to true and the given date is before current one).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

CarbonInterval

inDifferenceat line164
int diffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in years

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line177
int diffInQuarters(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in quarters rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line190
int diffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in months rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line205
int diffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weeks rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line218
int diffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in days rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line232
int diffInDaysFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in days using a filter closure rounded down.

Parameters

Closure $callback
CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line246
int diffInHoursFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours using a filter closure rounded down.

Parameters

Closure $callback
CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line261
int diffFiltered(CarbonInterval$ci,Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference by the given interval using a filter closure.

Parameters

CarbonInterval $ci An interval to traverse by
Closure $callback
CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line287
int diffInWeekdays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weekdays rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line302
int diffInWeekendDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weekend days using a filter rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line317
int diffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line330
int diffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours rounded down using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line343
int diffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in minutes rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line356
int diffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in minutes rounded down using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line369
int diffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in seconds rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line393
int diffInMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in microseconds.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line412
int diffInMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in milliseconds rounded down.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line425
int diffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in seconds using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line442
int diffInRealMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in microseconds using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line460
int diffInRealMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in milliseconds rounded down using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

int

inDifferenceat line473
float floatDiffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in seconds as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line486
float floatDiffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in minutes as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line499
float floatDiffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line512
float floatDiffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in days as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line534
float floatDiffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weeks as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line547
float floatDiffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in months as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line582
float floatDiffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in year as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line617
float floatDiffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in seconds as float (microsecond-precision) using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line630
float floatDiffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in minutes as float (microsecond-precision) using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line643
float floatDiffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in hours as float (microsecond-precision) using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line656
float floatDiffInRealDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in days as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line673
float floatDiffInRealWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in weeks as float (microsecond-precision).

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line686
float floatDiffInRealMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in months as float (microsecond-precision) using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line721
float floatDiffInRealYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)

Get the difference in year as float (microsecond-precision) using timestamps.

Parameters

CarbonInterface|DateTimeInterface|string|null $date
bool $absolute Get the absolute of the difference

Return Value

float

inDifferenceat line753
int secondsSinceMidnight()

The number of seconds since midnight.

Return Value

int

inDifferenceat line763
int secondsUntilEndOfDay()

The number of seconds until 23:59:59.

Return Value

int

inDifferenceat line815
string diffForHumans(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).

Parameters

Carbon|DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; if null passed, now will be used as comparison reference; if any other type, it will be converted to date and used as reference.
int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - 'syntax' entry (see below) - 'short' entry (see below) - 'parts' entry (see below) - 'options' entry (see below) - 'skip' entry, list of units to skip (array of strings or a single string, it can be the unit name (singular or plural) or its shortcut (y, m, w, d, h, min, s, ms, µs). - 'aUnit' entry, prefer "an hour" over "1 hour" if true - 'join' entry determines how to join multiple parts of the string - if $join is a string, it's used as a joiner glue - if $join is a callable/closure, it get the list of string and should return a string - if $join is an array, the first item will be the default glue, and the second item will be used instead of the glue for the last item - if $join is true, it will be guessed from the locale ('list' translation file entry) - if $join is missing, a space will be used as glue - 'other' entry (see above) - 'minimumUnit' entry determines the smallest unit of time to display can be long or ` short form of the units, e.g. 'hour' or 'h' (default value: s) if int passed, it add modifiers: Possible values: - CarbonInterface::DIFF_ABSOLUTE no modifiers - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier Default value: CarbonInterface::DIFF_ABSOLUTE
bool $short displays short format of time units
int $parts maximum number of parts to display (default value: 1: single unit)
int $options human diff options

Return Value

string

inDifferenceat line873
string from(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Parameters

Carbon|DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; if null passed, now will be used as comparison reference; if any other type, it will be converted to date and used as reference.
int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - 'syntax' entry (see below) - 'short' entry (see below) - 'parts' entry (see below) - 'options' entry (see below) - 'join' entry determines how to join multiple parts of the string - if $join is a string, it's used as a joiner glue - if $join is a callable/closure, it get the list of string and should return a string - if $join is an array, the first item will be the default glue, and the second item will be used instead of the glue for the last item - if $join is true, it will be guessed from the locale ('list' translation file entry) - if $join is missing, a space will be used as glue - 'other' entry (see above) if int passed, it add modifiers: Possible values: - CarbonInterface::DIFF_ABSOLUTE no modifiers - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier Default value: CarbonInterface::DIFF_ABSOLUTE
bool $short displays short format of time units
int $parts maximum number of parts to display (default value: 1: single unit)
int $options human diff options

Return Value

string

inDifferenceat line884
since($other =null,$syntax =null,$short =false,$parts =1,$options =null)

Parameters

$other
$syntax
$short
$parts
$options

inDifferenceat line937
string to(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from an other instance given (or now if null given) to current instance.

When comparing a value in the past to default now: 1 hour from now 5 months from now

When comparing a value in the future to default now: 1 hour ago 5 months ago

When comparing a value in the past to another value: 1 hour after 5 months after

When comparing a value in the future to another value: 1 hour before 5 months before

Parameters

Carbon|DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; if null passed, now will be used as comparison reference; if any other type, it will be converted to date and used as reference.
int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - 'syntax' entry (see below) - 'short' entry (see below) - 'parts' entry (see below) - 'options' entry (see below) - 'join' entry determines how to join multiple parts of the string - if $join is a string, it's used as a joiner glue - if $join is a callable/closure, it get the list of string and should return a string - if $join is an array, the first item will be the default glue, and the second item will be used instead of the glue for the last item - if $join is true, it will be guessed from the locale ('list' translation file entry) - if $join is missing, a space will be used as glue - 'other' entry (see above) if int passed, it add modifiers: Possible values: - CarbonInterface::DIFF_ABSOLUTE no modifiers - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier Default value: CarbonInterface::DIFF_ABSOLUTE
bool $short displays short format of time units
int $parts maximum number of parts to display (default value: 1: single unit)
int $options human diff options

Return Value

string

inDifferenceat line980
string until(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Parameters

Carbon|DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; if null passed, now will be used as comparison reference; if any other type, it will be converted to date and used as reference.
int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - 'syntax' entry (see below) - 'short' entry (see below) - 'parts' entry (see below) - 'options' entry (see below) - 'join' entry determines how to join multiple parts of the string - if $join is a string, it's used as a joiner glue - if $join is a callable/closure, it get the list of string and should return a string - if $join is an array, the first item will be the default glue, and the second item will be used instead of the glue for the last item - if $join is true, it will be guessed from the locale ('list' translation file entry) - if $join is missing, a space will be used as glue - 'other' entry (see above) if int passed, it add modifiers: Possible values: - CarbonInterface::DIFF_ABSOLUTE no modifiers - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier Default value: CarbonInterface::DIFF_ABSOLUTE
bool $short displays short format of time units
int $parts maximum number of parts to display (default value: 1: single unit)
int $options human diff options

Return Value

string

inDifferenceat line1013
string fromNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from current instance to now.

Parameters

int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - 'syntax' entry (see below) - 'short' entry (see below) - 'parts' entry (see below) - 'options' entry (see below) - 'join' entry determines how to join multiple parts of the string - if $join is a string, it's used as a joiner glue - if $join is a callable/closure, it get the list of string and should return a string - if $join is an array, the first item will be the default glue, and the second item will be used instead of the glue for the last item - if $join is true, it will be guessed from the locale ('list' translation file entry) - if $join is missing, a space will be used as glue if int passed, it add modifiers: Possible values: - CarbonInterface::DIFF_ABSOLUTE no modifiers - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier Default value: CarbonInterface::DIFF_ABSOLUTE
bool $short displays short format of time units
int $parts maximum number of parts to display (default value: 1: single unit)
int $options human diff options

Return Value

string

inDifferenceat line1052
string toNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from an other instance given to now

Parameters

int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - 'syntax' entry (see below) - 'short' entry (see below) - 'parts' entry (see below) - 'options' entry (see below) - 'join' entry determines how to join multiple parts of the string - if $join is a string, it's used as a joiner glue - if $join is a callable/closure, it get the list of string and should return a string - if $join is an array, the first item will be the default glue, and the second item will be used instead of the glue for the last item - if $join is true, it will be guessed from the locale ('list' translation file entry) - if $join is missing, a space will be used as glue if int passed, it add modifiers: Possible values: - CarbonInterface::DIFF_ABSOLUTE no modifiers - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier Default value: CarbonInterface::DIFF_ABSOLUTE
bool $short displays short format of time units
int $parts maximum number of parts to display (default value: 1: single part)
int $options human diff options

Return Value

string

inDifferenceat line1085
string ago(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)

Get the difference in a human readable format in the current locale from an other instance given to now

Parameters

int|array $syntax if array passed, parameters will be extracted from it, the array may contains: - 'syntax' entry (see below) - 'short' entry (see below) - 'parts' entry (see below) - 'options' entry (see below) - 'join' entry determines how to join multiple parts of the string - if $join is a string, it's used as a joiner glue - if $join is a callable/closure, it get the list of string and should return a string - if $join is an array, the first item will be the default glue, and the second item will be used instead of the glue for the last item - if $join is true, it will be guessed from the locale ('list' translation file entry) - if $join is missing, a space will be used as glue if int passed, it add modifiers: Possible values: - CarbonInterface::DIFF_ABSOLUTE no modifiers - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier Default value: CarbonInterface::DIFF_ABSOLUTE
bool $short displays short format of time units
int $parts maximum number of parts to display (default value: 1: single part)
int $options human diff options

Return Value

string

inDifferenceat line1102
string timespan($other =null,$timezone =null)

Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).

Parameters

$other
$timezone

Return Value

string

inDifferenceat line1127
string calendar(Carbon|DateTimeInterface|string|null$referenceTime =null,array$formats =[])

Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, or a calendar date (e.g. "10/29/2017") otherwise.

Language, date and time formats will change according to the current locale.

Parameters

Carbon|DateTimeInterface|string|null $referenceTime
array $formats

Return Value

string

inMixinat line66
staticvoid mixin(object|string$mixin)

Mix another object into the class.

Parameters

object|string $mixin

Return Value

void

Exceptions

ReflectionException

inMixinat line151
staticprotectedmixed bindMacroContext(Mixin|null$context,callable$callable)

Stack a Carbon context from inside calls of self::this() and execute a given action.

Parameters

Mixin|null $context
callable $callable

Return Value

mixed

Exceptions

Throwable

inMixinat line177
staticprotectedMixin|null context()

Return the current context from inside a macro callee or a null if static.

Return Value

Mixin|null

inMixinat line187
staticprotectedMixin this()

Return the current context from inside a macro callee or a new one if static.

Return Value

Mixin

inMacroat line57
staticvoid macro(string$name,object|callable$macro)

Register a custom macro.

Parameters

string $name
object|callable $macro

Return Value

void

inMacroat line65
static resetMacros()

Remove all macros and generic macros.

inMacroat line79
staticvoid genericMacro(object|callable$macro,int$priority =0)

Register a custom macro.

Parameters

object|callable $macro
int $priority marco with higher priority is tried first

Return Value

void

inMacroat line96
staticbool hasMacro(string$name)

Checks if macro is registered globally.

Parameters

string $name

Return Value

bool

inMacroat line108
staticcallable|null getMacro(string$name)

Get the raw callable macro registered globally for a given name.

Parameters

string $name

Return Value

callable|null

inMacroat line120
bool hasLocalMacro(string$name)

Checks if macro is registered globally or locally.

Parameters

string $name

Return Value

bool

inMacroat line132
callable|null getLocalMacro(string$name)

Get the raw callable macro registered globally or locally for a given name.

Parameters

string $name

Return Value

callable|null

inModifiersat line36
staticint getMidDayAt()

get midday/noon hour

Return Value

int

inModifiersat line55
staticvoid setMidDayAt(int$hour)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider mid-day is always 12pm, then if you need to test if it's an other hour, test it explicitly: $date->format('G') == 13 or to set explicitly to a given hour: $date->setTime(13, 0, 0, 0) Set midday/noon hour

Parameters

int $hour midday hour

Return Value

void

inModifiersat line65
Modifiers midDay()

Modify to midday, default to self::$midDayAt

Return Value

Modifiers

inWeekat line37
static next(int|string $day =null)

Parameters

int|string $day

Return Value

static

inModifiersat line117
Modifiers nextWeekday()

Go forward to the next weekday.

Return Value

Modifiers

inModifiersat line127
Modifiers previousWeekday()

Go backward to the previous weekday.

Return Value

Modifiers

inModifiersat line137
Modifiers nextWeekendDay()

Go forward to the next weekend day.

Return Value

Modifiers

inModifiersat line147
Modifiers previousWeekendDay()

Go backward to the previous weekend day.

Return Value

Modifiers

inModifiersat line162
Modifiers previous(string|int|null$modifier =null)

Modify to the previous occurrence of a given modifier such as a day of the week. If no dayOfWeek is provided, modify to the previous occurrence of the current day of the week. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

string|int|null $modifier

Return Value

Modifiers

inModifiersat line183
Modifiers firstOfMonth(int|null$dayOfWeek =null)

Modify to the first occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the first day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int|null $dayOfWeek

Return Value

Modifiers

inModifiersat line204
Modifiers lastOfMonth(int|null$dayOfWeek =null)

Modify to the last occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the last day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int|null $dayOfWeek

Return Value

Modifiers

inModifiersat line226
mixed nthOfMonth(int$nth,int$dayOfWeek)

Modify to the given occurrence of a given day of the week in the current month. If the calculated occurrence is outside the scope of the current month, then return false and no modifications are made.

Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int $nth
int $dayOfWeek

Return Value

mixed

inModifiersat line245
Modifiers firstOfQuarter(int|null$dayOfWeek =null)

Modify to the first occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the first day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int|null $dayOfWeek day of the week default null

Return Value

Modifiers

inModifiersat line260
Modifiers lastOfQuarter(int|null$dayOfWeek =null)

Modify to the last occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the last day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int|null $dayOfWeek day of the week default null

Return Value

Modifiers

inModifiersat line276
mixed nthOfQuarter(int$nth,int$dayOfWeek)

Modify to the given occurrence of a given day of the week in the current quarter. If the calculated occurrence is outside the scope of the current quarter, then return false and no modifications are made.

Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int $nth
int $dayOfWeek

Return Value

mixed

inModifiersat line296
Modifiers firstOfYear(int|null$dayOfWeek =null)

Modify to the first occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the first day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int|null $dayOfWeek day of the week default null

Return Value

Modifiers

inModifiersat line311
Modifiers lastOfYear(int|null$dayOfWeek =null)

Modify to the last occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the last day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int|null $dayOfWeek day of the week default null

Return Value

Modifiers

inModifiersat line327
mixed nthOfYear(int$nth,int$dayOfWeek)

Modify to the given occurrence of a given day of the week in the current year. If the calculated occurrence is outside the scope of the current year, then return false and no modifications are made.

Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int $nth
int $dayOfWeek

Return Value

mixed

inModifiersat line342
Modifiers average(Carbon|DateTimeInterface|null$date =null)

Modify the current instance to the average of a given instance (default now) and the current instance (second-precision).

Parameters

Carbon|DateTimeInterface|null $date

Return Value

Modifiers

inModifiersat line355
Modifiers closest(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)

Get the closest date from the instance (second-precision).

Parameters

Carbon|DateTimeInterface|mixed $date1
Carbon|DateTimeInterface|mixed $date2

Return Value

Modifiers

inModifiersat line368
Modifiers farthest(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)

Get the farthest date from the instance (second-precision).

Parameters

Carbon|DateTimeInterface|mixed $date1
Carbon|DateTimeInterface|mixed $date2

Return Value

Modifiers

inModifiersat line380
Modifiers min(Carbon|DateTimeInterface|mixed$date =null)

Get the minimum instance between a given instance (default now) and the current instance.

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

Modifiers

inModifiersat line396
Modifiers minimum(Carbon|DateTimeInterface|mixed$date =null)

Get the minimum instance between a given instance (default now) and the current instance.

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

Modifiers

See also

min()

inModifiersat line408
Modifiers max(Carbon|DateTimeInterface|mixed$date =null)

Get the maximum instance between a given instance (default now) and the current instance.

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

Modifiers

inModifiersat line424
Modifiers maximum(Carbon|DateTimeInterface|mixed$date =null)

Get the maximum instance between a given instance (default now) and the current instance.

Parameters

Carbon|DateTimeInterface|mixed $date

Return Value

Modifiers

See also

max()

inModifiersat line437
modify($modify)

Parameters

$modify

inModifiersat line456
Modifiers change(string$modifier)

Similar to native modify() method of DateTime but can handle more grammars.

Parameters

string $modifier

Return Value

Modifiers

inCastat line31
DateTimeInterface cast(string$className)

Cast the current instance into the given class.

Parameters

string $className The $className::instance() method will be called to cast the current object.

Return Value

DateTimeInterface

at line519
staticbool isMutable()

Returns true if the current class/instance is mutable.

Return Value

bool

inMutabilityat line41
staticbool isImmutable()

Returns true if the current class/instance is immutable.

Return Value

bool

inMutabilityat line51
Carbon toMutable()

Return a mutable copy of the instance.

Return Value

Carbon

inMutabilityat line64
CarbonImmutable toImmutable()

Return a immutable copy of the instance.

Return Value

CarbonImmutable

inLocalizationat line70
static setHumanDiffOptions(int$humanDiffOptions)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

Parameters

int $humanDiffOptions

See also

settings

inLocalizationat line82
static enableHumanDiffOption(int$humanDiffOption)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

Parameters

int $humanDiffOption

See also

settings

inLocalizationat line94
static disableHumanDiffOption(int$humanDiffOption)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

Parameters

int $humanDiffOption

See also

settings

inLocalizationat line104
staticint getHumanDiffOptions()

Return default humanDiff() options (merged flags as integer).

Return Value

int

inLocalizationat line114
staticTranslatorInterface getTranslator()

Get the default translator instance in use.

Return Value

TranslatorInterface

inLocalizationat line126
staticvoid setTranslator(TranslatorInterface$translator)

Set the default translator instance to use.

Parameters

TranslatorInterface $translator

Return Value

void

inLocalizationat line136
bool hasLocalTranslator()

Return true if the current instance has its own translator.

Return Value

bool

inLocalizationat line146
TranslatorInterface getLocalTranslator()

Get the translator of the current instance or the default if none set.

Return Value

TranslatorInterface

inLocalizationat line158
$this setLocalTranslator(TranslatorInterface$translator)

Set the translator for the current instance.

Parameters

TranslatorInterface $translator

Return Value

$this

inLocalizationat line175
staticstring getTranslationMessageWith(TranslatorInterface$translator,string$key,string|null$locale =null,string|null$default =null)

Returns raw translation message for a given key.

Parameters

TranslatorInterface $translator the translator to use
string $key key to find
string|null $locale current locale used if null
string|null $default default value if translation returns the key

Return Value

string

inLocalizationat line203
string getTranslationMessage(string$key,string|null$locale =null,string|null$default =null,TranslatorInterface$translator =null)

Returns raw translation message for a given key.

Parameters

string $key key to find
string|null $locale current locale used if null
string|null $default default value if translation returns the key
TranslatorInterface $translator an optional translator to use

Return Value

string

inLocalizationat line218
staticstring translateWith(TranslatorInterface$translator,string$key,array$parameters =[],null$number =null)

Translate using translation string or callback available.

Parameters

TranslatorInterface $translator
string $key
array $parameters
null $number

Return Value

string

inLocalizationat line252
string translate(string$key,array$parameters =[],string|int|float|null$number =null,TranslatorInterface|null$translator =null,bool$altNumbers =false)

Translate using translation string or callback available.

Parameters

string $key
array $parameters
string|int|float|null $number
TranslatorInterface|null $translator
bool $altNumbers

Return Value

string

inLocalizationat line270
string translateNumber(int$number)

Returns the alternative number for a given integer if available in the current locale.

Parameters

int $number

Return Value

string

inLocalizationat line329
staticstring translateTimeString(string$timeString,string|null$from =null,string|null$to =null,int$mode =CarbonInterface::TRANSLATE_ALL)

Translate a time string from a locale to an other.

Parameters

string $timeString date/time/duration string to translate (may also contain English)
string|null $from input locale of the $timeString parameter (Carbon::getLocale() by default)
string|null $to output locale of the result returned ("en" by default)
int $mode specify what to translate with options: - CarbonInterface::TRANSLATE_ALL (default) - CarbonInterface::TRANSLATE_MONTHS - CarbonInterface::TRANSLATE_DAYS - CarbonInterface::TRANSLATE_UNITS - CarbonInterface::TRANSLATE_MERIDIEM You can use pipe to group: CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS

Return Value

string

inLocalizationat line425
string translateTimeStringTo(string$timeString,string|null$to =null)

Translate a time string from the current locale ($date->locale()) to an other.

Parameters

string $timeString time string to translate
string|null $to output locale of the result returned ("en" by default)

Return Value

string

inLocalizationat line438
$this|string locale(string$locale =null,string...$fallbackLocales)

Get/set the locale for the current instance.

Parameters

string $locale
string ...$fallbackLocales

Return Value

$this|string

inLocalizationat line470
staticstring getLocale()

Get the current translator locale.

Return Value

string

inLocalizationat line483
staticbool setLocale(string$locale)

Set the current translator locale and indicate if the source locale file exists.

Pass 'auto' as locale to use closest language from the current LC_TIME locale.

Parameters

string $locale locale ex. en

Return Value

bool

inLocalizationat line495
static setFallbackLocale(string$locale)

Set the fallback locale.

inLocalizationat line520
staticstring|null getFallbackLocale()

Get the fallback locale.

inLocalizationat line540
staticmixed executeWithLocale(string$locale,callable$func)

Set the current locale to the given, execute the passed function, reset the locale to previous one, then return the result of the closure (or null if the closure was void).

Parameters

string $locale locale ex. en
callable $func

Return Value

mixed

inLocalizationat line557
staticbool localeHasShortUnits(string$locale)

Returns true if the given locale is internally supported and has short-units support.

Support is considered enabled if either year, day or hour has a short variant translated.

Parameters

string $locale locale ex. en

Return Value

bool

inLocalizationat line578
staticbool localeHasDiffSyntax(string$locale)

Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).

Support is considered enabled if the 4 sentences are translated in the given locale.

Parameters

string $locale locale ex. en

Return Value

bool

inLocalizationat line609
staticbool localeHasDiffOneDayWords(string$locale)

Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).

Support is considered enabled if the 3 words are translated in the given locale.

Parameters

string $locale locale ex. en

Return Value

bool

inLocalizationat line627
staticbool localeHasDiffTwoDayWords(string$locale)

Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).

Support is considered enabled if the 2 words are translated in the given locale.

Parameters

string $locale locale ex. en

Return Value

bool

inLocalizationat line644
staticbool localeHasPeriodSyntax(string$locale)

Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).

Support is considered enabled if the 4 sentences are translated in the given locale.

Parameters

string $locale locale ex. en

Return Value

bool

inLocalizationat line661
staticarray getAvailableLocales()

Returns the list of internally available locales and already loaded custom locales.

(It will ignore custom translator dynamic loading.)

Return Value

array

inLocalizationat line676
staticLanguage[] getAvailableLocalesInfo()

Returns list of Language object for each available locale. This object allow you to get the ISO name, native name, region and variant of the locale.

Return Value

Language[]

inLocalizationat line691
staticprotectedTranslatorInterface translator()

Initialize the default translator instance if necessary.

Return Value

TranslatorInterface

inLocalizationat line710
protectedstring|null getTranslatorLocale(null$translator =null)

Get the locale of a given translator.

If null or omitted, current local translator is used. If no local translator is in use, current global translator is used.

Parameters

null $translator

Return Value

string|null

inLocalizationat line728
staticprotectedLocaleAwareInterface|null getLocaleAwareTranslator(LocaleAwareInterface|null$translator =null)

Throw an error if passed object is not LocaleAwareInterface.

Parameters

LocaleAwareInterface|null $translator

Return Value

LocaleAwareInterface|null

inOptionsat line246
static useStrictMode(bool$strictModeEnabled =true)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.

Parameters

bool $strictModeEnabled

See also

settings Enable the strict mode (or disable with passing false).

inOptionsat line257
staticbool isStrictModeEnabled()

Returns true if the strict mode is globally in use, false else.

(It can be overridden in specific instances.)

Return Value

bool

inOptionsat line275
staticvoid useMonthsOverflow(bool$monthsOverflow =true)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

Parameters

bool $monthsOverflow

Return Value

void

See also

settings Indicates if months should be calculated with overflow.

inOptionsat line291
staticvoid resetMonthsOverflow()deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

Return Value

void

See also

settings Reset the month overflow behavior.

inOptionsat line301
staticbool shouldOverflowMonths()

Get the month overflow global behavior (can be overridden in specific instances).

Return Value

bool

inOptionsat line319
staticvoid useYearsOverflow(bool$yearsOverflow =true)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

Parameters

bool $yearsOverflow

Return Value

void

See also

settings Indicates if years should be calculated with overflow.

inOptionsat line335
staticvoid resetYearsOverflow()deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).

Return Value

void

See also

settings Reset the month overflow behavior.

inOptionsat line345
staticbool shouldOverflowYears()

Get the month overflow global behavior (can be overridden in specific instances).

Return Value

bool

inOptionsat line367
$this|Options settings(array$settings)

Set specific options.

  • strictMode: true|false|null
    • monthOverflow: true|false|null
    • yearOverflow: true|false|null
    • humanDiffOptions: int|null
    • toStringFormat: string|Closure|null
    • toJsonFormat: string|Closure|null
    • locale: string|null
    • timezone: \DateTimeZone|string|int|null
    • macros: array|null
    • genericMacros: array|null

Parameters

array $settings

Return Value

$this|Options

inOptionsat line405
array getSettings()

Returns current local settings.

Return Value

array

inOptionsat line438
array __debugInfo()

Show truthy properties on var_dump().

Return Value

array

inOptionsat line455
protected addExtraDebugInfos($infos)

Parameters

$infos

inOptionsat line27
CarbonImmutable shiftTimezone($timezone)

Set the timezone

Parameters

$timezone

Return Value

CarbonImmutable

inIntervalRoundingat line23
protected callRoundMethod(string$method,array$parameters)

Parameters

string $method
array $parameters

inIntervalRoundingat line38
protected roundWith($precision,$function)

Parameters

$precision
$function

inRoundingat line40
CarbonInterface roundUnit(string$unit,float|int$precision =1,string$function ='round')

Round the current instance at the given unit with given precision if specified and the given function.

Parameters

string $unit
float|int $precision
string $function

Return Value

CarbonInterface

inRoundingat line134
CarbonInterface floorUnit(string$unit,float|int$precision =1)

Truncate the current instance at the given unit with given precision if specified.

Parameters

string $unit
float|int $precision

Return Value

CarbonInterface

inRoundingat line147
CarbonInterface ceilUnit(string$unit,float|int$precision =1)

Ceil the current instance at the given unit with given precision if specified.

Parameters

string $unit
float|int $precision

Return Value

CarbonInterface

inRoundingat line160
CarbonInterface round(float|int|string|DateInterval|null$precision =1,string$function ='round')

Round the current instance second with given precision if specified.

Parameters

float|int|string|DateInterval|null $precision
string $function

Return Value

CarbonInterface

inRoundingat line172
CarbonInterface floor(float|int|string|DateInterval|null$precision =1)

Round the current instance second with given precision if specified.

Parameters

float|int|string|DateInterval|null $precision

Return Value

CarbonInterface

inRoundingat line184
CarbonInterface ceil(float|int|string|DateInterval|null$precision =1)

Ceil the current instance second with given precision if specified.

Parameters

float|int|string|DateInterval|null $precision

Return Value

CarbonInterface

inRoundingat line196
CarbonInterface roundWeek(int$weekStartsAt =null)

Round the current instance week.

Parameters

int $weekStartsAt optional start allow you to specify the day of week to use to start the week

Return Value

CarbonInterface

inRoundingat line211
CarbonInterface floorWeek(int$weekStartsAt =null)

Truncate the current instance week.

Parameters

int $weekStartsAt optional start allow you to specify the day of week to use to start the week

Return Value

CarbonInterface

inRoundingat line223
CarbonInterface ceilWeek(int$weekStartsAt =null)

Ceil the current instance week.

Parameters

int $weekStartsAt optional start allow you to specify the day of week to use to start the week

Return Value

CarbonInterface

inSerializationat line73
string serialize()

Return a serialized string of the instance.

Return Value

string

inSerializationat line87
staticSerialization fromSerialized(string$value)

Create an instance from a serialized string.

Parameters

string $value

Return Value

Serialization

Exceptions

InvalidFormatException

inSerializationat line106
static __set_state($dump)

Parameters

$dump

inSerializationat line125
array __sleep()

Returns the list of properties to dump on serialize() called on.

Return Value

array

inSerializationat line137
__serialize()

inSerializationat line176
__wakeup()

inSerializationat line204
__unserialize(array$data)

Parameters

array $data

inSerializationat line235
jsonSerialize()

inSerializationat line258
staticvoid serializeUsing(callable$callback)deprecated

deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather transform Carbon object before the serialization. JSON serialize all Carbon instances using the given callback.

Parameters

callable $callback

Return Value

void

inSerializationat line270
cleanupDumpProperties()

Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.

foreach ($date as $_) {} serializer($date) var_export($date) get_object_vars($date)

inTestat line64
static setTestNow(DateTimeInterface|Closure|Test|string|false|null$testNow =null)

Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: - A call to the static now() method, ex. Carbon::now() - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - When a string containing the desired time is passed to Carbon::parse().

Note the timezone parameter was left out of the examples above and has no affect as the mock value will be returned regardless of its value.

Only the moment is mocked with setTestNow(), the timezone will still be the one passed as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()).

To clear the test instance call this method using the default parameter of null.

/!\ Use this method for unit tests only.

Parameters

DateTimeInterface|Closure|Test|string|false|null $testNow real or mock Carbon instance

inTestat line90
static setTestNowAndTimezone($testNow =null,$tz =null)

Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: - A call to the static now() method, ex. Carbon::now() - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - When a string containing the desired time is passed to Carbon::parse().

It will also align default timezone (e.g. call date_default_timezone_set()) with the second argument or if null, with the timezone of the given date object.

To clear the test instance call this method using the default parameter of null.

/!\ Use this method for unit tests only.

Parameters

$testNow
$tz

inTestat line127
staticmixed withTestNow(DateTimeInterface|Closure|Test|string|false|null$testNow =null,Closure|null$callback =null)

Temporarily sets a static date to be used within the callback.

Using setTestNow to set the date, executing the callback, then clearing the test instance.

/!\ Use this method for unit tests only.

Parameters

DateTimeInterface|Closure|Test|string|false|null $testNow real or mock Carbon instance
Closure|null $callback

Return Value

mixed

inTestat line146
staticClosure|Test getTestNow()

Get the Carbon instance (real or mock) to be returned when a "now" instance is created.

Return Value

Closure|Test the current instance used for testing

inTestat line157
staticbool hasTestNow()

Determine if there is a valid test instance set. A valid test instance is anything that is not null.

Return Value

bool true if there is a test instance, otherwise false

inTestat line169
staticprotectedCarbonImmutable|Carbon|null getMockedTestNow(string|DateTimeZone$tz)

Get the mocked date passed in setTestNow() and if it's a Closure, execute it.

Parameters

string|DateTimeZone $tz

Return Value

CarbonImmutable|Carbon|null

inTestat line187
staticprotected mockConstructorParameters($time,$tz)

Parameters

$time
$tz

inTimestampat line29
staticTimestamp createFromTimestamp(float|int|string$timestamp,DateTimeZone|string|null$tz =null)

Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).

Timestamp input can be given as int, float or a string containing one or more numbers.

Parameters

float|int|string $timestamp
DateTimeZone|string|null $tz

Return Value

Timestamp

inTimestampat line43
staticTimestamp createFromTimestampUTC(float|int|string$timestamp)

Create a Carbon instance from an timestamp keeping the timezone to UTC.

Timestamp input can be given as int, float or a string containing one or more numbers.

Parameters

float|int|string $timestamp

Return Value

Timestamp

inTimestampat line63
staticTimestamp createFromTimestampMsUTC(float|int|string$timestamp)

Create a Carbon instance from a timestamp in milliseconds.

Timestamp input can be given as int, float or a string containing one or more numbers.

Parameters

float|int|string $timestamp

Return Value

Timestamp

inTimestampat line88
staticTimestamp createFromTimestampMs(float|int|string$timestamp,DateTimeZone|string|null$tz =null)

Create a Carbon instance from a timestamp in milliseconds.

Timestamp input can be given as int, float or a string containing one or more numbers.

Parameters

float|int|string $timestamp
DateTimeZone|string|null $tz

Return Value

Timestamp

inTimestampat line103
Timestamp timestamp(float|int|string$unixTimestamp)

Set the instance's timestamp.

Timestamp input can be given as int, float or a string containing one or more numbers.

Parameters

float|int|string $unixTimestamp

Return Value

Timestamp

inTimestampat line126
float getPreciseTimestamp(int$precision =6)

Returns a timestamp rounded with the given precision (6 by default).

Parameters

int $precision

Return Value

float

inTimestampat line136
float valueOf()

Returns the milliseconds timestamps used amongst other by Date javascript objects.

Return Value

float

inTimestampat line146
int getTimestampMs()

Returns the timestamp with millisecond precision.

Return Value

int

inTimestampat line158
int unix()

Return Value

int

inUnitsat line38
Units addRealUnit(string$unit,int$value =1)

Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.

Parameters

string $unit
int $value

Return Value

Units

inUnitsat line139
subRealUnit($unit,$value =1)

Parameters

$unit
$value

inUnitsat line151
staticbool isModifiableUnit(string$unit)

Returns true if a property can be changed via setter.

Parameters

string $unit

Return Value

bool

inUnitsat line178
Units rawAdd(DateInterval$interval)

Call native PHP DateTime/DateTimeImmutable add() method.

Parameters

DateInterval $interval

Return Value

Units

inUnitsat line197
add($unit,$value =1,$overflow =null)

Parameters

$unit
$value
$overflow

inUnitsat line231
Units addUnit(string$unit,int$value =1,bool|null$overflow =null)

Add given units to the current instance.

Parameters

string $unit
int $value
bool|null $overflow

Return Value

Units

inUnitsat line329
Units subUnit(string$unit,int$value =1,bool|null$overflow =null)

Subtract given units to the current instance.

Parameters

string $unit
int $value
bool|null $overflow

Return Value

Units

inUnitsat line341
Units rawSub(DateInterval$interval)

Call native PHP DateTime/DateTimeImmutable sub() method.

Parameters

DateInterval $interval

Return Value

Units

inUnitsat line360
sub($unit,$value =1,$overflow =null)

Parameters

$unit
$value
$overflow

inUnitsat line396
Units subtract(string|DateInterval$unit,int$value =1,bool|null$overflow =null)

Subtract given units or interval to the current instance.

Parameters

string|DateInterval $unit
int $value
bool|null $overflow

Return Value

Units

See also

sub()

inWeekat line50
int|Week isoWeekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

Set/get the week number of year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

Parameters

int|null $year if null, act as a getter, if not null, set the year and return current instance.
int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
int|null $dayOfYear first day of year included in the week #1

Return Value

int|Week

inWeekat line70
int|Week weekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

Set/get the week number of year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

Parameters

int|null $year if null, act as a getter, if not null, set the year and return current instance.
int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
int|null $dayOfYear first day of year included in the week #1

Return Value

int|Week

inWeekat line132
int isoWeeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)

Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

Parameters

int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
int|null $dayOfYear first day of year included in the week #1

Return Value

int

inWeekat line150
int weeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)

Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

Parameters

int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
int|null $dayOfYear first day of year included in the week #1

Return Value

int

inWeekat line180
int|Week week(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

Get/set the week number using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

Parameters

int|null $week
int|null $dayOfWeek
int|null $dayOfYear

Return Value

int|Week

inWeekat line211
int|Week isoWeek(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

Get/set the week number using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

Parameters

int|null $week
int|null $dayOfWeek
int|null $dayOfYear

Return Value

int|Week

inWeekat line37
static addWeeks(int $weeks =1)

Parameters

int $weeks

Return Value

static

inWeekat line37
static dayOfYear(int $dayOfYear)

Parameters

int $dayOfYear

Return Value

static

inWeekat line37
static subWeeks(int $weeks =1)

Parameters

int $weeks

Return Value

static

inWeekat line37
static year(int $year =null)

Parameters

int $year

Return Value

static

inDateat line623
staticprotectedCarbonTimeZone|false safeCreateDateTimeZone(DateTimeZone|string|int|null$object,DateTimeZone|string|int|null$objectDump =null)

Creates a DateTimeZone from a string, DateTimeZone or integer offset.

Parameters

DateTimeZone|string|int|null $object original value to get CarbonTimeZone from it.
DateTimeZone|string|int|null $objectDump dump of the object for error messages.

Return Value

CarbonTimeZone|false

Exceptions

InvalidTimeZoneException

inDateat line636
getTimezone()

inDateat line646
staticprotectedarray getRangesByUnit(int$daysInMonth =31)

List of minimum and maximums for each unit.

Parameters

int $daysInMonth

Return Value

array

inDateat line681
Date clone()

Return Value

Date

inDateat line694
Date avoidMutation()

Clone the current instance if it's mutable.

This method is convenient to ensure you don't mutate the initial object but avoid to make a useless copy of it if it's already immutable.

Return Value

Date

inDateat line721
staticprotected expectDateTime(mixed$date,string|array$other =[])

Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface.

Parameters

mixed $date
string|array $other

Exceptions

InvalidTypeException

inDateat line768
protectedDate resolveUTC(Carbon|DateTimeInterface|string|null$date =null)

Return the Carbon instance passed through, a now instance in UTC if null given or parse the input if string given (using current timezone then switching to UTC).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

Date

inDateat line791
Date carbonize(Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null$date =null)

Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.

Parameters

Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null $date

Return Value

Date

inDateat line817
string|int|bool|DateTimeZone|null __get(string$name)

Get a part of the Carbon object

Parameters

string $name

Return Value

string|int|bool|DateTimeZone|null

Exceptions

UnknownGetterException

inDateat line831
string|int|bool|DateTimeZone|null get(string$name)

Get a part of the Carbon object

Parameters

string $name

Return Value

string|int|bool|DateTimeZone|null

Exceptions

UnknownGetterException

inDateat line1087
bool __isset(string$name)

Check if an attribute exists on the object

Parameters

string $name

Return Value

bool

inDateat line1108
void __set(string$name,string|int|DateTimeZone$value)

Set a part of the Carbon object

Parameters

string $name
string|int|DateTimeZone $value

Return Value

void

Exceptions

ReflectionException

inDateat line1129
$this set(string|array$name,string|int|DateTimeZone$value =null)

Set a part of the Carbon object

Parameters

string|array $name
string|int|DateTimeZone $value

Return Value

$this

Exceptions

UnknownSetterException

inDateat line1250
protected getTranslatedFormByRegExp($baseKey,$keySuffix,$context,$subKey,$defaultValue)

Parameters

$baseKey
$keySuffix
$context
$subKey
$defaultValue

inDateat line1279
string getTranslatedDayName(string|null$context =null,string$keySuffix ='',string|null$defaultValue =null)

Get the translation of the current week day name (with context for languages with multiple forms).

Parameters

string|null $context whole format string
string $keySuffix "", "_short" or "_min"
string|null $defaultValue default value if translation missing

Return Value

string

inDateat line1291
string getTranslatedShortDayName(string|null$context =null)

Get the translation of the current short week day name (with context for languages with multiple forms).

Parameters

string|null $context whole format string

Return Value

string

inDateat line1303
string getTranslatedMinDayName(string|null$context =null)

Get the translation of the current abbreviated week day name (with context for languages with multiple forms).

Parameters

string|null $context whole format string

Return Value

string

inDateat line1317
string getTranslatedMonthName(string|null$context =null,string$keySuffix ='',string|null$defaultValue =null)

Get the translation of the current month day name (with context for languages with multiple forms).

Parameters

string|null $context whole format string
string $keySuffix "" or "_short"
string|null $defaultValue default value if translation missing

Return Value

string

inDateat line1329
string getTranslatedShortMonthName(string|null$context =null)

Get the translation of the current short month day name (with context for languages with multiple forms).

Parameters

string|null $context whole format string

Return Value

string

inDateat line1355
Date|int weekday(int|null$value =null)

Get/set the weekday from 0 (Sunday) to 6 (Saturday).

Parameters

int|null $value new value for weekday if using as setter.

Return Value

Date|int

inDateat line1369
Date|int isoWeekday(int|null$value =null)

Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).

Parameters

int|null $value new value for weekday if using as setter.

Return Value

Date|int

inDateat line1385
Date setUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)

Set any unit to a new value without overflowing current other unit given.

Parameters

string $valueUnit unit name to modify
int $value new value for the input unit
string $overflowUnit unit name to not overflow

Return Value

Date

inDateat line1414
Date addUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)

Add any unit to a new value without overflowing current other unit given.

Parameters

string $valueUnit unit name to modify
int $value amount to add to the input unit
string $overflowUnit unit name to not overflow

Return Value

Date

inDateat line1428
Date subUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)

Subtract any unit to a new value without overflowing current other unit given.

Parameters

string $valueUnit unit name to modify
int $value amount to subtract to the input unit
string $overflowUnit unit name to not overflow

Return Value

Date

inDateat line1440
int|Date utcOffset(int$minuteOffset =null)

Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.

Parameters

int $minuteOffset

Return Value

int|Date

inDateat line1461
setDate($year,$month,$day)

Parameters

$year
$month
$day

inDateat line1478
setISODate($year,$week,$day =1)

Parameters

$year
$week
$day

inDateat line1496
Date setDateTime(int$year,int$month,int$day,int$hour,int$minute,int$second =0,int$microseconds =0)

Set the date and time all together.

Parameters

int $year
int $month
int $day
int $hour
int $minute
int $second
int $microseconds

Return Value

Date

inDateat line1514
setTime($hour,$minute,$second =0,$microseconds =0)

Parameters

$hour
$minute
$second
$microseconds

inDateat line1529
setTimestamp($unixTimestamp)

Parameters

$unixTimestamp

inDateat line1543
Date setTimeFromTimeString(string$time)

Set the time by time string.

Parameters

string $time

Return Value

Date

inDateat line1559
Date timezone(DateTimeZone|string$value)

Parameters

DateTimeZone|string $value

Return Value

Date

inDateat line1571
Date|string tz(DateTimeZone|string$value =null)

Set the timezone or returns the timezone name if no arguments passed.

Parameters

DateTimeZone|string $value

Return Value

Date|string

inDateat line1588
setTimezone($value)

Parameters

$value

inDateat line1620
Date utc()

Set the instance's timezone to UTC.

Return Value

Date

inDateat line1632
Date setDateFrom(Carbon|DateTimeInterface$date =null)

Set the year, month, and date for this instance to that of the passed instance.

Parameters

Carbon|DateTimeInterface $date now if null

Return Value

Date

inDateat line1646
Date setTimeFrom(Carbon|DateTimeInterface$date =null)

Set the hour, minute, second and microseconds for this instance to that of the passed instance.

Parameters

Carbon|DateTimeInterface $date now if null

Return Value

Date

inDateat line1660
Date setDateTimeFrom(Carbon|DateTimeInterface$date =null)

Set the date and time for this instance to that of the passed instance.

Parameters

Carbon|DateTimeInterface $date

Return Value

Date

inDateat line1672
staticarray getDays()

Get the days of the week

Return Value

array

inDateat line1694
staticint getWeekStartsAt()

Get the first day of week

Return Value

int

inDateat line1715
staticvoid setWeekStartsAt(int|string$day)deprecated

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

Parameters

int|string $day week start day (or 'auto' to get the first day of week from Carbon::getLocale() culture).

Return Value

void

inDateat line1725
staticint getWeekEndsAt()

Get the last day of week

Return Value

int

inDateat line1747
staticvoid setWeekEndsAt(int|string$day)deprecated

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

Parameters

int|string $day week end day (or 'auto' to get the day before the first day of week from Carbon::getLocale() culture).

Return Value

void

inDateat line1757
staticarray getWeekendDays()

Get weekend days

Return Value

array

inDateat line1789
staticvoid setWeekendDays(array$days)deprecated

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

Parameters

array $days

Return Value

void

inDateat line1801
staticbool hasRelativeKeywords(string$time)

Determine if a time string will produce a relative date.

Parameters

string $time

Return Value

bool true if time match a relative date, false if absolute or invalid time string

inDateat line1827
static setUtf8(bool$utf8)deprecated

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.

Parameters

bool $utf8

inDateat line1844
string formatLocalized(string$format)deprecated

deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. Use ->isoFormat() instead. Deprecated since 2.55.0

Format the instance with the current locale. You can set the current locale using setlocale() https://php.net/setlocale.

Parameters

string $format

Return Value

string

inDateat line1872
array getIsoFormats(string|null$locale =null)

Returns list of locale formats for ISO formatting.

Parameters

string|null $locale current locale used if null

Return Value

array

inDateat line1891
array getCalendarFormats(string|null$locale =null)

Returns list of calendar formats for ISO formatting.

Parameters

string|null $locale current locale used if null

Return Value

array

inDateat line1908
staticarray getIsoUnits()

Returns list of locale units for ISO formatting.

Return Value

array

inDateat line2042
string getPaddedUnit(string$unit,int$length =2,string$padString ='0',int$padType =STR_PAD_LEFT)

Returns a unit of the instance padded with 0 by default or any other string if specified.

Parameters

string $unit Carbon unit name
int $length Length of the output (2 by default)
string $padString String to use for padding ("0" by default)
int $padType Side(s) to pad (STR_PAD_LEFT by default)

Return Value

string

inDateat line2055
string ordinal(string$key,string|null$period =null)

Return a property with its ordinal.

Parameters

string $key
string|null $period

Return Value

string

inDateat line2073
string meridiem(bool$isLower =false)

Return the meridiem of the current time in the current locale.

Parameters

bool $isLower if true, returns lowercase variant if available in the current locale.

Return Value

string

inDateat line2113
string getAltNumber(string$key)

Returns the alternative number for a given date property if available in the current locale.

Parameters

string $key date property

Return Value

string

inDateat line2126
string isoFormat(string$format,string|null$originalFormat =null)

Format in the current language using ISO replacement patterns.

Parameters

string $format
string|null $originalFormat provide context if a chunk has been passed alone

Return Value

string

inDateat line2221
staticarray getFormatsToIsoReplacements()

List of replacements from date() format to isoFormat().

Return Value

array

inDateat line2282
string translatedFormat(string$format)

Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) but translate words whenever possible (months, day names, etc.) using the current locale.

Parameters

string $format

Return Value

string

inDateat line2365
string getOffsetString(string$separator =':')

Returns the offset hour and minute formatted with +/- and a given separator (":" by default).

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

string $separator string to place between hours and minutes (":" by default)

Return Value

string

inDateat line2376
staticprotected executeStaticCallable($macro,...$parameters)

Parameters

$macro
...$parameters

inDateat line2399
staticmixed __callStatic(string$method,array$parameters)

Dynamically handle calls to the class.

Parameters

string $method magic method name called
array $parameters parameters list

Return Value

mixed

Exceptions

BadMethodCallException

inDateat line2427
Date setUnit(string$unit,int$value =null)

Set specified unit to new given value.

Parameters

string $unit year, month, day, hour, minute, second or microsecond
int $value new value for given unit

Return Value

Date

inDateat line2457
staticstring singularUnit(string$unit)

Returns standardized singular of a given singular/plural unit name (in English).

Parameters

string $unit

Return Value

string

inDateat line2479
staticstring pluralUnit(string$unit)

Returns standardized plural of a given singular/plural unit name (in English).

Parameters

string $unit

Return Value

string

inDateat line2494
protected executeCallable($macro,...$parameters)

Parameters

$macro
...$parameters

inDateat line2505
protected executeCallableWithContext($macro,...$parameters)

Parameters

$macro
...$parameters

inDateat line2512
staticprotected getGenericMacros()

inDateat line2531
mixed __call(string$method,array$parameters)

Dynamically handle calls to the class.

Parameters

string $method magic method name called
array $parameters parameters list

Return Value

mixed

Exceptions

Throwable

at line510
bool isUtc()

Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)

Return Value

bool

at line510
bool isLocal()

Check if the current instance has non-UTC timezone.

Return Value

bool

at line510
bool isValid()

Check if the current instance is a valid date.

Return Value

bool

at line510
bool isDST()

Check if the current instance is in a daylight saving time.

Return Value

bool

at line510
bool isSunday()

Checks if the instance day is sunday.

Return Value

bool

at line510
bool isMonday()

Checks if the instance day is monday.

Return Value

bool

at line510
bool isTuesday()

Checks if the instance day is tuesday.

Return Value

bool

at line510
bool isWednesday()

Checks if the instance day is wednesday.

Return Value

bool

at line510
bool isThursday()

Checks if the instance day is thursday.

Return Value

bool

at line510
bool isFriday()

Checks if the instance day is friday.

Return Value

bool

at line510
bool isSaturday()

Checks if the instance day is saturday.

Return Value

bool

at line510
bool isSameYear(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentYear()

Checks if the instance is in the same year as the current moment.

Return Value

bool

at line510
bool isNextYear()

Checks if the instance is in the same year as the current moment next year.

Return Value

bool

at line510
bool isLastYear()

Checks if the instance is in the same year as the current moment last year.

Return Value

bool

at line510
bool isSameWeek(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentWeek()

Checks if the instance is in the same week as the current moment.

Return Value

bool

at line510
bool isNextWeek()

Checks if the instance is in the same week as the current moment next week.

Return Value

bool

at line510
bool isLastWeek()

Checks if the instance is in the same week as the current moment last week.

Return Value

bool

at line510
bool isSameDay(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentDay()

Checks if the instance is in the same day as the current moment.

Return Value

bool

at line510
bool isNextDay()

Checks if the instance is in the same day as the current moment next day.

Return Value

bool

at line510
bool isLastDay()

Checks if the instance is in the same day as the current moment last day.

Return Value

bool

at line510
bool isSameHour(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentHour()

Checks if the instance is in the same hour as the current moment.

Return Value

bool

at line510
bool isNextHour()

Checks if the instance is in the same hour as the current moment next hour.

Return Value

bool

at line510
bool isLastHour()

Checks if the instance is in the same hour as the current moment last hour.

Return Value

bool

at line510
bool isSameMinute(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentMinute()

Checks if the instance is in the same minute as the current moment.

Return Value

bool

at line510
bool isNextMinute()

Checks if the instance is in the same minute as the current moment next minute.

Return Value

bool

at line510
bool isLastMinute()

Checks if the instance is in the same minute as the current moment last minute.

Return Value

bool

at line510
bool isSameSecond(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentSecond()

Checks if the instance is in the same second as the current moment.

Return Value

bool

at line510
bool isNextSecond()

Checks if the instance is in the same second as the current moment next second.

Return Value

bool

at line510
bool isLastSecond()

Checks if the instance is in the same second as the current moment last second.

Return Value

bool

at line510
bool isSameMicro(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentMicro()

Checks if the instance is in the same microsecond as the current moment.

Return Value

bool

at line510
bool isNextMicro()

Checks if the instance is in the same microsecond as the current moment next microsecond.

Return Value

bool

at line510
bool isLastMicro()

Checks if the instance is in the same microsecond as the current moment last microsecond.

Return Value

bool

at line510
bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentMicrosecond()

Checks if the instance is in the same microsecond as the current moment.

Return Value

bool

at line510
bool isNextMicrosecond()

Checks if the instance is in the same microsecond as the current moment next microsecond.

Return Value

bool

at line510
bool isLastMicrosecond()

Checks if the instance is in the same microsecond as the current moment last microsecond.

Return Value

bool

at line510
bool isCurrentMonth()

Checks if the instance is in the same month as the current moment.

Return Value

bool

at line510
bool isNextMonth()

Checks if the instance is in the same month as the current moment next month.

Return Value

bool

at line510
bool isLastMonth()

Checks if the instance is in the same month as the current moment last month.

Return Value

bool

at line510
bool isCurrentQuarter()

Checks if the instance is in the same quarter as the current moment.

Return Value

bool

at line510
bool isNextQuarter()

Checks if the instance is in the same quarter as the current moment next quarter.

Return Value

bool

at line510
bool isLastQuarter()

Checks if the instance is in the same quarter as the current moment last quarter.

Return Value

bool

at line510
bool isSameDecade(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentDecade()

Checks if the instance is in the same decade as the current moment.

Return Value

bool

at line510
bool isNextDecade()

Checks if the instance is in the same decade as the current moment next decade.

Return Value

bool

at line510
bool isLastDecade()

Checks if the instance is in the same decade as the current moment last decade.

Return Value

bool

at line510
bool isSameCentury(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentCentury()

Checks if the instance is in the same century as the current moment.

Return Value

bool

at line510
bool isNextCentury()

Checks if the instance is in the same century as the current moment next century.

Return Value

bool

at line510
bool isLastCentury()

Checks if the instance is in the same century as the current moment last century.

Return Value

bool

at line510
bool isSameMillennium(Carbon|DateTimeInterface|string|null $date =null)

Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).

Parameters

Carbon|DateTimeInterface|string|null $date

Return Value

bool

at line510
bool isCurrentMillennium()

Checks if the instance is in the same millennium as the current moment.

Return Value

bool

at line510
bool isNextMillennium()

Checks if the instance is in the same millennium as the current moment next millennium.

Return Value

bool

at line510
bool isLastMillennium()

Checks if the instance is in the same millennium as the current moment last millennium.

Return Value

bool

inDateat line527
CarbonInterface years(int $value)

Set current instance year to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setYears(int $value)

Set current instance year to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setYear(int $value)

Set current instance year to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface months(int $value)

Set current instance month to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface month(int $value)

Set current instance month to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMonths(int $value)

Set current instance month to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMonth(int $value)

Set current instance month to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface days(int $value)

Set current instance day to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface day(int $value)

Set current instance day to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setDays(int $value)

Set current instance day to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setDay(int $value)

Set current instance day to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface hours(int $value)

Set current instance hour to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface hour(int $value)

Set current instance hour to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setHours(int $value)

Set current instance hour to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setHour(int $value)

Set current instance hour to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface minutes(int $value)

Set current instance minute to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface minute(int $value)

Set current instance minute to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMinutes(int $value)

Set current instance minute to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMinute(int $value)

Set current instance minute to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface seconds(int $value)

Set current instance second to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface second(int $value)

Set current instance second to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setSeconds(int $value)

Set current instance second to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setSecond(int $value)

Set current instance second to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface millis(int $value)

Set current instance millisecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface milli(int $value)

Set current instance millisecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMillis(int $value)

Set current instance millisecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMilli(int $value)

Set current instance millisecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface milliseconds(int $value)

Set current instance millisecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface millisecond(int $value)

Set current instance millisecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMilliseconds(int $value)

Set current instance millisecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMillisecond(int $value)

Set current instance millisecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface micros(int $value)

Set current instance microsecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface micro(int $value)

Set current instance microsecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMicros(int $value)

Set current instance microsecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMicro(int $value)

Set current instance microsecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface microseconds(int $value)

Set current instance microsecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface microsecond(int $value)

Set current instance microsecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMicroseconds(int $value)

Set current instance microsecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface setMicrosecond(int $value)

Set current instance microsecond to the given value.

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYears(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYear()

Add one year to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYears(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYear()

Sub one year to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYearsWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYearWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYearsWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYearWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYearsWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYearWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYearsWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYearWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYearsWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYearWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYearsWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYearWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYearsNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addYearNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYearsNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subYearNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonths(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonth()

Add one month to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonths(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonth()

Sub one month to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonthsWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonthWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonthsWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonthWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonthsWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonthWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonthsWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonthWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonthsWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonthWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonthsWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonthWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonthsNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMonthNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonthsNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMonthNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDays(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDay()

Add one day to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDays(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDay()

Sub one day to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addHours(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addHour()

Add one hour to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subHours(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subHour()

Sub one hour to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMinutes(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMinute()

Add one minute to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMinutes(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMinute()

Sub one minute to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addSeconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addSecond()

Add one second to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subSeconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subSecond()

Sub one second to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillis(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMilli()

Add one millisecond to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillis(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMilli()

Sub one millisecond to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMilliseconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillisecond()

Add one millisecond to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMilliseconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillisecond()

Sub one millisecond to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMicros(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMicro()

Add one microsecond to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMicros(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMicro()

Sub one microsecond to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMicroseconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMicrosecond()

Add one microsecond to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMicroseconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMicrosecond()

Sub one microsecond to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillennia(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillennium()

Add one millennium to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillennia(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillennium()

Sub one millennium to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillenniaWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillenniumWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillenniaWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillenniumWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillenniaWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillenniumWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillenniaWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillenniumWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillenniaWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillenniumWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillenniaWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillenniumWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillenniaNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addMillenniumNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillenniaNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subMillenniumNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturies(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCentury()

Add one century to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturies(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCentury()

Sub one century to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturiesWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturyWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturiesWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturyWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturiesWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturyWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturiesWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturyWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturiesWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturyWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturiesWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturyWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturiesNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addCenturyNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturiesNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subCenturyNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecades(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecade()

Add one decade to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecades(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecade()

Sub one decade to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecadesWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecadeWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecadesWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecadeWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecadesWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecadeWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecadesWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecadeWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecadesWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecadeWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecadesWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecadeWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecadesNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addDecadeNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecadesNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subDecadeNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuarters(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuarter()

Add one quarter to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuarters(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuarter()

Sub one quarter to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuartersWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuarterWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuartersWithOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuarterWithOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuartersWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuarterWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuartersWithoutOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuarterWithoutOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuartersWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuarterWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuartersWithNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuarterWithNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuartersNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addQuarterNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuartersNoOverflow(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subQuarterNoOverflow()

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

Return Value

CarbonInterface

inDateat line527
CarbonInterface addWeek()

Add one week to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subWeek()

Sub one week to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addWeekdays(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addWeekday()

Add one weekday to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subWeekdays(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subWeekday()

Sub one weekday to the instance (using date interval).

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealMicros(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealMicro()

Add one microsecond to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMicros(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMicro()

Sub one microsecond to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod microsUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealMicroseconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealMicrosecond()

Add one microsecond to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMicroseconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMicrosecond()

Sub one microsecond to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod microsecondsUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealMillis(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealMilli()

Add one millisecond to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMillis(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMilli()

Sub one millisecond to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod millisUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealMilliseconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealMillisecond()

Add one millisecond to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMilliseconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMillisecond()

Sub one millisecond to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod millisecondsUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealSeconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealSecond()

Add one second to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealSeconds(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealSecond()

Sub one second to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod secondsUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealMinutes(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealMinute()

Add one minute to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMinutes(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMinute()

Sub one minute to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod minutesUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealHours(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealHour()

Add one hour to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealHours(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealHour()

Sub one hour to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod hoursUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealDays(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealDay()

Add one day to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealDays(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealDay()

Sub one day to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod daysUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealWeeks(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealWeek()

Add one week to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealWeeks(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealWeek()

Sub one week to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod weeksUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealMonths(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealMonth()

Add one month to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMonths(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMonth()

Sub one month to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod monthsUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealQuarters(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealQuarter()

Add one quarter to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealQuarters(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealQuarter()

Sub one quarter to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod quartersUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealYears(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealYear()

Add one year to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealYears(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealYear()

Sub one year to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod yearsUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealDecades(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealDecade()

Add one decade to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealDecades(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealDecade()

Sub one decade to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod decadesUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealCenturies(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealCentury()

Add one century to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealCenturies(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealCentury()

Sub one century to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod centuriesUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface addRealMillennia(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface addRealMillennium()

Add one millennium to the instance (using timestamp).

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMillennia(int $value =1)

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

Parameters

int $value

Return Value

CarbonInterface

inDateat line527
CarbonInterface subRealMillennium()

Sub one millennium to the instance (using timestamp).

Return Value

CarbonInterface

at line510
CarbonPeriod millenniaUntil($endDate =null,int $factor =1)

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
int $factor

Return Value

CarbonPeriod

inDateat line527
CarbonInterface roundYear(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundYears(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorYear(float $precision =1)

Truncate the current instance year with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorYears(float $precision =1)

Truncate the current instance year with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilYear(float $precision =1)

Ceil the current instance year with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilYears(float $precision =1)

Ceil the current instance year with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMonth(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMonths(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMonth(float $precision =1)

Truncate the current instance month with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMonths(float $precision =1)

Truncate the current instance month with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMonth(float $precision =1)

Ceil the current instance month with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMonths(float $precision =1)

Ceil the current instance month with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundDay(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundDays(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorDay(float $precision =1)

Truncate the current instance day with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorDays(float $precision =1)

Truncate the current instance day with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilDay(float $precision =1)

Ceil the current instance day with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilDays(float $precision =1)

Ceil the current instance day with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundHour(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundHours(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorHour(float $precision =1)

Truncate the current instance hour with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorHours(float $precision =1)

Truncate the current instance hour with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilHour(float $precision =1)

Ceil the current instance hour with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilHours(float $precision =1)

Ceil the current instance hour with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMinute(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMinutes(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMinute(float $precision =1)

Truncate the current instance minute with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMinutes(float $precision =1)

Truncate the current instance minute with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMinute(float $precision =1)

Ceil the current instance minute with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMinutes(float $precision =1)

Ceil the current instance minute with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundSecond(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundSeconds(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorSecond(float $precision =1)

Truncate the current instance second with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorSeconds(float $precision =1)

Truncate the current instance second with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilSecond(float $precision =1)

Ceil the current instance second with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilSeconds(float $precision =1)

Ceil the current instance second with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMillennium(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMillennia(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMillennium(float $precision =1)

Truncate the current instance millennium with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMillennia(float $precision =1)

Truncate the current instance millennium with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMillennium(float $precision =1)

Ceil the current instance millennium with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMillennia(float $precision =1)

Ceil the current instance millennium with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundCentury(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundCenturies(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorCentury(float $precision =1)

Truncate the current instance century with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorCenturies(float $precision =1)

Truncate the current instance century with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilCentury(float $precision =1)

Ceil the current instance century with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilCenturies(float $precision =1)

Ceil the current instance century with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundDecade(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundDecades(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorDecade(float $precision =1)

Truncate the current instance decade with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorDecades(float $precision =1)

Truncate the current instance decade with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilDecade(float $precision =1)

Ceil the current instance decade with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilDecades(float $precision =1)

Ceil the current instance decade with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundQuarter(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundQuarters(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorQuarter(float $precision =1)

Truncate the current instance quarter with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorQuarters(float $precision =1)

Truncate the current instance quarter with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilQuarter(float $precision =1)

Ceil the current instance quarter with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilQuarters(float $precision =1)

Ceil the current instance quarter with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMillisecond(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMilliseconds(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMillisecond(float $precision =1)

Truncate the current instance millisecond with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMilliseconds(float $precision =1)

Truncate the current instance millisecond with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMillisecond(float $precision =1)

Ceil the current instance millisecond with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMilliseconds(float $precision =1)

Ceil the current instance millisecond with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMicrosecond(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface roundMicroseconds(float $precision =1,string $function ="round")

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

Parameters

float $precision
string $function

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMicrosecond(float $precision =1)

Truncate the current instance microsecond with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface floorMicroseconds(float $precision =1)

Truncate the current instance microsecond with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMicrosecond(float $precision =1)

Ceil the current instance microsecond with given precision.

Parameters

float $precision

Return Value

CarbonInterface

inDateat line527
CarbonInterface ceilMicroseconds(float $precision =1)

Ceil the current instance microsecond with given precision.

Parameters

float $precision

Return Value

CarbonInterface

at line510
string shortAbsoluteDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Parameters

DateTimeInterface $other
int $parts

Return Value

string

at line510
string longAbsoluteDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Parameters

DateTimeInterface $other
int $parts

Return Value

string

at line510
string shortRelativeDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Parameters

DateTimeInterface $other
int $parts

Return Value

string

at line510
string longRelativeDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Parameters

DateTimeInterface $other
int $parts

Return Value

string

at line510
string shortRelativeToNowDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Parameters

DateTimeInterface $other
int $parts

Return Value

string

at line510
string longRelativeToNowDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Parameters

DateTimeInterface $other
int $parts

Return Value

string

at line510
string shortRelativeToOtherDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Parameters

DateTimeInterface $other
int $parts

Return Value

string

at line510
string longRelativeToOtherDiffForHumans(DateTimeInterface $other =null,int $parts =1)

Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)

Parameters

DateTimeInterface $other
int $parts

Return Value

string