Methods |
public
|
__call(string $method, array $parameters): mixed
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Parameters
$method |
magic method name called
|
$parameters |
parameters list
|
Throws
|
#
|
public
static
|
__callStatic(string $method, array $parameters): mixed
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Parameters
$method |
magic method name called
|
$parameters |
parameters list
|
Throws
|
#
|
public
|
__clone()
Update constructedObjectId on cloned.
Update constructedObjectId on cloned.
Implemented by
|
#
|
public
|
__construct(DateTimeInterface|string|null $time = null, DateTimeZone|string|null $tz = null)
Create a new Carbon instance.
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.
Throws
|
#
|
public
|
__debugInfo(): array
Show truthy properties on var_dump().
Show truthy properties on var_dump().
|
#
|
public
|
__get(string $name): string|int|bool|DateTimeZone|null
Get a part of the Carbon object
Get a part of the Carbon object
Throws
|
#
|
public
|
__isset(string $name): bool
Check if an attribute exists on the object
Check if an attribute exists on the object
|
#
|
public
|
__serialize(): array
Returns the values to dump on serialize() called on.
Returns the values to dump on serialize() called on.
Only used by PHP >= 7.4.
|
#
|
public
|
__set(string $name, string|int|DateTimeZone $value): void
Set a part of the Carbon object
Set a part of the Carbon object
Throws
|
#
|
public
static
|
__set_state(string|array $dump): static
The __set_state handler.
|
#
|
public
|
__sleep(): array
Returns the list of properties to dump on serialize() called on.
Returns the list of properties to dump on serialize() called on.
Only used by PHP < 7.4.
|
#
|
public
|
__toString(): string
Format the instance as a string using the set format
Format the instance as a string using the set format
|
#
|
public
|
__unserialize(array $data): void
Set locale if specified on unserialize() called.
Set locale if specified on unserialize() called.
Only used by PHP >= 7.4.
|
#
|
public
|
add(string|DateInterval|Closure|CarbonConverterInterface $unit, int $value = 1, bool|null $overflow = null): static
Add given units or interval to the current instance.
Add given units or interval to the current instance.
|
#
|
public
|
addRealUnit(string $unit, int $value = 1): static
Add seconds to the instance using timestamp. Positive $value travels
forward while negative $value travels into the…
Add seconds to the instance using timestamp. Positive $value travels
forward while negative $value travels into the past.
|
#
|
public
|
addUnit(string $unit, int $value = 1, bool|null $overflow = null): static
Add given units to the current instance.
Add given units to the current instance.
|
#
|
public
|
addUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static
Add any unit to a new value without overflowing current other unit given.
Add any unit to a new value without overflowing current other unit given.
Parameters
$valueUnit |
unit name to modify
|
$value |
amount to add to the input unit
|
$overflowUnit |
unit name to not overflow
|
|
#
|
public
|
ago(int|array $syntax = null, bool $short = false, int $parts = 1, int $options = null): string
Get the difference in a human readable format in the current locale from an other
instance given to now
Get the difference in a human readable format in the current locale from an other
instance given to now
Parameters
$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
|
$short |
displays short format of time units
|
$parts |
maximum number of parts to display (default value: 1: single part)
|
$options |
human diff options
|
|
#
|
public
|
average(Carbon|DateTimeInterface|null $date = null): static
Modify the current instance to the average of a given instance (default now) and the current instance
(second-precision…
Modify the current instance to the average of a given instance (default now) and the current instance
(second-precision).
|
#
|
public
|
avoidMutation(): static
Clone the current instance if it's mutable.
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.
|
#
|
public
|
between(Carbon|DateTimeInterface|mixed $date1, Carbon|DateTimeInterface|mixed $date2, bool $equal = true): bool
Determines if the instance is between two others.
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
$equal |
Indicates if an equal to comparison should be done
|
|
#
|
public
|
betweenExcluded(Carbon|DateTimeInterface|mixed $date1, Carbon|DateTimeInterface|mixed $date2): bool
Determines if the instance is between two others, bounds excluded.
Determines if the instance is between two others, bounds excluded.
|
#
|
public
|
betweenIncluded(Carbon|DateTimeInterface|mixed $date1, Carbon|DateTimeInterface|mixed $date2): bool
Determines if the instance is between two others, bounds included.
Determines if the instance is between two others, bounds included.
|
#
|
public
|
calendar(Carbon|DateTimeInterface|string|null $referenceTime = null, array $formats = []): string
Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days,
or a calendar…
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.
|
#
|
public
static
|
canBeCreatedFromFormat(string $date, string $format): bool
Checks if the (date)time string is in a given format and valid to create a
new instance.
Checks if the (date)time string is in a given format and valid to create a
new instance.
|
#
|
public
|
carbonize(Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null $date = null): static
Return the Carbon instance passed through, a now instance in the same timezone
if null given or parse the input if…
Return the Carbon instance passed through, a now instance in the same timezone
if null given or parse the input if string given.
|
#
|
public
|
cast(string $className): DateTimeInterface
Cast the current instance into the given class.
Cast the current instance into the given class.
Parameters
$className |
The $className::instance() method will be called to cast the current object.
|
|
#
|
public
|
ceil(float|int|string|DateInterval|null $precision = 1): CarbonInterface
Ceil the current instance second with given precision if specified.
Ceil the current instance second with given precision if specified.
|
#
|
public
|
ceilUnit(string $unit, float|int $precision = 1): CarbonInterface
Ceil the current instance at the given unit with given precision if specified.
Ceil the current instance at the given unit with given precision if specified.
|
#
|
public
|
ceilWeek(int $weekStartsAt = null): CarbonInterface
Ceil the current instance week.
Ceil the current instance week.
Parameters
$weekStartsAt |
optional start allow you to specify the day of week to use to start the week
|
|
#
|
public
|
change(string $modifier): static|false
Similar to native modify() method of DateTime but can handle more grammars.
Similar to native modify() method of DateTime but can handle more grammars.
|
#
|
public
|
cleanupDumpProperties()
Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.
foreach ($date as $_)…
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)
|
#
|
public
|
clone(): static
|
#
|
public
|
closest(Carbon|DateTimeInterface|mixed $date1, Carbon|DateTimeInterface|mixed $date2): static
Get the closest date from the instance (second-precision).
Get the closest date from the instance (second-precision).
|
#
|
public
|
copy(): static
Get a copy of the instance.
Get a copy of the instance.
|
#
|
public
static
|
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,
): static|false
Create a new Carbon instance from a specific date and time.
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.
Throws
|
#
|
public
static
|
createFromDate(
int|null $year = null,
int|null $month = null,
int|null $day = null,
DateTimeZone|string|null $tz = null,
): static
Create a Carbon instance from just a date. The time portion is set to now.
Create a Carbon instance from just a date. The time portion is set to now.
Throws
|
#
|
public
static
|
createFromFormat(string $format, string $time, DateTimeZone|string|false|null $tz = null): static|false
Create a Carbon instance from a specific format.
Create a Carbon instance from a specific format.
Parameters
Throws
Implemented by
|
#
|
public
static
|
createFromIsoFormat(
string $format,
string $time,
DateTimeZone|string|false|null $tz = null,
string|null $locale = 'en',
TranslatorInterface $translator = null,
): static|false
Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).
Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).
Parameters
$format |
Datetime format
|
$tz |
optional timezone
|
$locale |
locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use)
|
$translator |
optional custom translator to use for macro-formats
|
Throws
|
#
|
public
static
|
createFromLocaleFormat(
string $format,
string $locale,
string $time,
DateTimeZone|string|false|null $tz = null,
): static|false
Create a Carbon instance from a specific format and a string in a given language.
Create a Carbon instance from a specific format and a string in a given language.
Parameters
Throws
|
#
|
public
static
|
createFromLocaleIsoFormat(
string $format,
string $locale,
string $time,
DateTimeZone|string|false|null $tz = null,
): static|false
Create a Carbon instance from a specific ISO format and a string in a given language.
Create a Carbon instance from a specific ISO format and a string in a given language.
Parameters
$format |
Datetime ISO format
|
Throws
|
#
|
public
static
|
createFromTime(
int|null $hour = 0,
int|null $minute = 0,
int|null $second = 0,
DateTimeZone|string|null $tz = null,
): static
Create a Carbon instance from just a time. The date portion is set to today.
Create a Carbon instance from just a time. The date portion is set to today.
Throws
|
#
|
public
static
|
createFromTimeString(string $time, DateTimeZone|string|null $tz = null): static
Create a Carbon instance from a time string. The date portion is set to today.
Create a Carbon instance from a time string. The date portion is set to today.
Throws
|
#
|
public
static
|
createFromTimestamp(float|int|string $timestamp, DateTimeZone|string|null $tz = null): static
Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).
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.
|
#
|
public
static
|
createFromTimestampMs(float|int|string $timestamp, DateTimeZone|string|null $tz = null): static
Create a Carbon instance from a timestamp in milliseconds.
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.
|
#
|
public
static
|
createFromTimestampMsUTC(float|int|string $timestamp): static
Create a Carbon instance from a timestamp in milliseconds.
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.
|
#
|
public
static
|
createFromTimestampUTC(float|int|string $timestamp): static
Create a Carbon instance from an timestamp keeping the timezone to UTC.
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.
|
#
|
public
static
|
createMidnightDate(
int|null $year = null,
int|null $month = null,
int|null $day = null,
DateTimeZone|string|null $tz = null,
): static
Create a Carbon instance from just a date. The time portion is set to midnight.
Create a Carbon instance from just a date. The time portion is set to midnight.
Throws
|
#
|
public
static
|
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,
): static|false
Create a new safe Carbon instance from a specific date and time.
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.
Throws
|
#
|
public
static
|
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,
): static
Create a new Carbon instance from a specific date and time using strict validation.
Create a new Carbon instance from a specific date and time using strict validation.
Throws
|
#
|
public
|
dayOfYear(int|null $value = null): static|int
Get/set the day of year.
Parameters
$value |
new value for day of year if using as setter.
|
|
#
|
public
|
diffAsCarbonInterval(
CarbonInterface|DateTimeInterface|string|null $date = null,
bool $absolute = true,
array $skip = [],
): CarbonInterval
Get the difference as a CarbonInterval instance.
Return relative interval (negative if $absolute flag is not set to…
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
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffFiltered(
CarbonInterval $ci,
Closure $callback,
CarbonInterface|DateTimeInterface|string|null $date = null,
bool $absolute = true,
): int
Get the difference by the given interval using a filter closure.
Get the difference by the given interval using a filter closure.
Parameters
$ci |
An interval to traverse by
|
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffForHumans(
Carbon|DateTimeInterface|string|array|null $other = null,
int|array $syntax = null,
bool $short = false,
int $parts = 1,
int $options = null,
): string
Get the difference in a human readable format in the current locale from current instance to an other
instance given …
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 |
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.
|
$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
|
$short |
displays short format of time units
|
$parts |
maximum number of parts to display (default value: 1: single unit)
|
$options |
human diff options
|
|
#
|
public
|
diffInDays(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in days rounded down.
Get the difference in days rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInDaysFiltered(
Closure $callback,
CarbonInterface|DateTimeInterface|string|null $date = null,
bool $absolute = true,
): int
Get the difference in days using a filter closure rounded down.
Get the difference in days using a filter closure rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInHours(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in hours rounded down.
Get the difference in hours rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInHoursFiltered(
Closure $callback,
CarbonInterface|DateTimeInterface|string|null $date = null,
bool $absolute = true,
): int
Get the difference in hours using a filter closure rounded down.
Get the difference in hours using a filter closure rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInMicroseconds(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in microseconds.
Get the difference in microseconds.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInMilliseconds(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in milliseconds rounded down.
Get the difference in milliseconds rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInMinutes(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in minutes rounded down.
Get the difference in minutes rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInMonths(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in months rounded down.
Get the difference in months rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInQuarters(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in quarters rounded down.
Get the difference in quarters rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInRealHours(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in hours rounded down using timestamps.
Get the difference in hours rounded down using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInRealMicroseconds(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in microseconds using timestamps.
Get the difference in microseconds using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInRealMilliseconds(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in milliseconds rounded down using timestamps.
Get the difference in milliseconds rounded down using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInRealMinutes(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in minutes rounded down using timestamps.
Get the difference in minutes rounded down using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInRealSeconds(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in seconds using timestamps.
Get the difference in seconds using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInSeconds(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in seconds rounded down.
Get the difference in seconds rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInWeekdays(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in weekdays rounded down.
Get the difference in weekdays rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInWeekendDays(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in weekend days using a filter rounded down.
Get the difference in weekend days using a filter rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInWeeks(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in weeks rounded down.
Get the difference in weeks rounded down.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
diffInYears(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): int
Get the difference in years
Get the difference in years
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
static
|
disableHumanDiffOption(int $humanDiffOption)
Deprecated
To avoid conflict between different third-party libraries, static setters should not be used.
You should rather use the ->settings() method.
|
#
|
public
static
|
enableHumanDiffOption(int $humanDiffOption)
Deprecated
To avoid conflict between different third-party libraries, static setters should not be used.
You should rather use the ->settings() method.
|
#
|
public
|
endOf(string $unit, array<int, mixed> ...$params): static
Modify to end of current given unit.
Modify to end of current given unit.
|
#
|
public
|
endOfCentury(): static
Resets the date to end of the century and time to 23:59:59.999999
Resets the date to end of the century and time to 23:59:59.999999
|
#
|
public
|
endOfDay(): static
Resets the time to 23:59:59.999999 end of day
Resets the time to 23:59:59.999999 end of day
|
#
|
public
|
endOfDecade(): static
Resets the date to end of the decade and time to 23:59:59.999999
Resets the date to end of the decade and time to 23:59:59.999999
|
#
|
public
|
endOfHour(): static
Modify to end of current hour, minutes and seconds become 59
Modify to end of current hour, minutes and seconds become 59
|
#
|
public
|
endOfMillennium(): static
Resets the date to end of the millennium and time to 23:59:59.999999
Resets the date to end of the millennium and time to 23:59:59.999999
|
#
|
public
|
endOfMinute(): static
Modify to end of current minute, seconds become 59
Modify to end of current minute, seconds become 59
|
#
|
public
|
endOfMonth(): static
Resets the date to end of the month and time to 23:59:59.999999
Resets the date to end of the month and time to 23:59:59.999999
|
#
|
public
|
endOfQuarter(): static
Resets the date to end of the quarter and time to 23:59:59.999999
Resets the date to end of the quarter and time to 23:59:59.999999
|
#
|
public
|
endOfSecond(): static
Modify to end of current second, microseconds become 999999
Modify to end of current second, microseconds become 999999
|
#
|
public
|
endOfWeek(int $weekEndsAt = null): static
Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
Parameters
$weekEndsAt |
optional start allow you to specify the day of week to use to end the week
|
|
#
|
public
|
endOfYear(): static
Resets the date to end of the year and time to 23:59:59.999999
Resets the date to end of the year and time to 23:59:59.999999
|
#
|
public
|
eq(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is equal to another
Determines if the instance is equal to another
|
#
|
public
|
equalTo(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is equal to another
Determines if the instance is equal to another
|
#
|
public
static
|
executeWithLocale(string $locale, callable $func): mixed
Set the current locale to the given, execute the passed function, reset the locale to previous one,
then return the…
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
|
#
|
public
|
farthest(Carbon|DateTimeInterface|mixed $date1, Carbon|DateTimeInterface|mixed $date2): static
Get the farthest date from the instance (second-precision).
Get the farthest date from the instance (second-precision).
|
#
|
public
|
firstOfMonth(int|null $dayOfWeek = null): static
Modify to the first occurrence of a given day of the week
in the current month. If no dayOfWeek is provided, modify to…
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.
|
#
|
public
|
firstOfQuarter(int|null $dayOfWeek = null): static
Modify to the first occurrence of a given day of the week
in the current quarter. If no dayOfWeek is provided, modify…
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
$dayOfWeek |
day of the week default null
|
|
#
|
public
|
firstOfYear(int|null $dayOfWeek = null): static
Modify to the first occurrence of a given day of the week
in the current year. If no dayOfWeek is provided, modify to…
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
$dayOfWeek |
day of the week default null
|
|
#
|
public
|
floatDiffInDays(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in days as float (microsecond-precision).
Get the difference in days as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInHours(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in hours as float (microsecond-precision).
Get the difference in hours as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInMinutes(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in minutes as float (microsecond-precision).
Get the difference in minutes as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInMonths(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in months as float (microsecond-precision).
Get the difference in months as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInRealDays(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in days as float (microsecond-precision).
Get the difference in days as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInRealHours(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in hours as float (microsecond-precision) using timestamps.
Get the difference in hours as float (microsecond-precision) using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInRealMinutes(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in minutes as float (microsecond-precision) using timestamps.
Get the difference in minutes as float (microsecond-precision) using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInRealMonths(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in months as float (microsecond-precision) using timestamps.
Get the difference in months as float (microsecond-precision) using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInRealSeconds(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in seconds as float (microsecond-precision) using timestamps.
Get the difference in seconds as float (microsecond-precision) using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInRealWeeks(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in weeks as float (microsecond-precision).
Get the difference in weeks as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInRealYears(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in year as float (microsecond-precision) using timestamps.
Get the difference in year as float (microsecond-precision) using timestamps.
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInSeconds(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in seconds as float (microsecond-precision).
Get the difference in seconds as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInWeeks(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in weeks as float (microsecond-precision).
Get the difference in weeks as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floatDiffInYears(CarbonInterface|DateTimeInterface|string|null $date = null, bool $absolute = true): float
Get the difference in year as float (microsecond-precision).
Get the difference in year as float (microsecond-precision).
Parameters
$absolute |
Get the absolute of the difference
|
|
#
|
public
|
floor(float|int|string|DateInterval|null $precision = 1): CarbonInterface
Round the current instance second with given precision if specified.
Round the current instance second with given precision if specified.
|
#
|
public
|
floorUnit(string $unit, float|int $precision = 1): CarbonInterface
Truncate the current instance at the given unit with given precision if specified.
Truncate the current instance at the given unit with given precision if specified.
|
#
|
public
|
floorWeek(int $weekStartsAt = null): CarbonInterface
Truncate the current instance week.
Truncate the current instance week.
Parameters
$weekStartsAt |
optional start allow you to specify the day of week to use to start the week
|
|
#
|
public
|
formatLocalized(string $format): string
Format the instance with the current locale. You can set the current
locale using setlocale() https://php.net…
Deprecated
It uses OS language package and strftime() which is deprecated since PHP 8.1.
Use ->isoFormat() instead.
Deprecated since 2.55.0
|
#
|
public
|
from(
Carbon|DateTimeInterface|string|array|null $other = null,
int|array $syntax = null,
bool $short = false,
int $parts = 1,
int $options = null,
): string
Parameters
$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.
|
$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
|
$short |
displays short format of time units
|
$parts |
maximum number of parts to display (default value: 1: single unit)
|
$options |
human diff options
|
|
#
|
public
|
fromNow(int|array $syntax = null, bool $short = false, int $parts = 1, int $options = null): string
Get the difference in a human readable format in the current locale from current
instance to now.
Get the difference in a human readable format in the current locale from current
instance to now.
Parameters
$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
|
$short |
displays short format of time units
|
$parts |
maximum number of parts to display (default value: 1: single unit)
|
$options |
human diff options
|
|
#
|
public
static
|
fromSerialized(string $value): static
Create an instance from a serialized string.
Create an instance from a serialized string.
Throws
|
#
|
public
static
|
genericMacro(object|callable $macro, int $priority = 0): void
Register a custom macro.
Parameters
$priority |
marco with higher priority is tried first
|
|
#
|
public
|
get(string $name): string|int|bool|DateTimeZone|null
Get a part of the Carbon object
Get a part of the Carbon object
Throws
|
#
|
public
|
getAltNumber(string $key): string
Returns the alternative number for a given date property if available in the current locale.
Returns the alternative number for a given date property if available in the current locale.
Parameters
|
#
|
public
static
|
getAvailableLocales(): array
Returns the list of internally available locales and already loaded custom locales.
(It will ignore custom translator…
Returns the list of internally available locales and already loaded custom locales.
(It will ignore custom translator dynamic loading.)
|
#
|
public
static
|
getAvailableLocalesInfo(): Language[]
Returns list of Language object for each available locale. This object allow you to get the ISO name, native
name,…
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.
|
#
|
public
|
getCalendarFormats(string|null $locale = null): array
Returns list of calendar formats for ISO formatting.
Returns list of calendar formats for ISO formatting.
Parameters
$locale |
current locale used if null
|
|
#
|
public
static
|
getDays(): array
Get the days of the week
|
#
|
public
|
getDaysFromStartOfWeek(int|null $weekStartsAt = null): int
Return the number of days since the start of the week (using the current locale or the first parameter
if explicitly…
Return the number of days since the start of the week (using the current locale or the first parameter
if explicitly given).
Parameters
$weekStartsAt |
optional start allow you to specify the day of week to use to start the week,
if not provided, start of week is inferred from the locale
(Sunday for en_US, Monday for de_DE, etc.)
|
|
#
|
public
static
|
getFallbackLocale(): string|null
Get the fallback locale.
|
#
|
public
static
|
getFormatsToIsoReplacements(): array
List of replacements from date() format to isoFormat().
List of replacements from date() format to isoFormat().
|
#
|
public
static
|
getHumanDiffOptions(): int
Return default humanDiff() options (merged flags as integer).
Return default humanDiff() options (merged flags as integer).
|
#
|
public
|
getIsoFormats(string|null $locale = null): array
Returns list of locale formats for ISO formatting.
Returns list of locale formats for ISO formatting.
Parameters
$locale |
current locale used if null
|
|
#
|
public
static
|
getIsoUnits(): array
Returns list of locale units for ISO formatting.
Returns list of locale units for ISO formatting.
|
#
|
public
static
|
getLastErrors(): array
{@inheritdoc}
|
#
|
public
|
getLocalMacro(string $name): callable|null
Get the raw callable macro registered globally or locally for a given name.
Get the raw callable macro registered globally or locally for a given name.
|
#
|
public
|
getLocalTranslator(): TranslatorInterface
Get the translator of the current instance or the default if none set.
Get the translator of the current instance or the default if none set.
|
#
|
public
static
|
getLocale(): string
Get the current translator locale.
Get the current translator locale.
|
#
|
public
static
|
getMacro(string $name): callable|null
Get the raw callable macro registered globally for a given name.
Get the raw callable macro registered globally for a given name.
|
#
|
public
static
|
getMidDayAt(): int
get midday/noon hour
|
#
|
public
|
getOffsetString(string $separator = ':'): string
Returns the offset hour and minute formatted with +/- and a given separator (":" by default).
For example, if the time…
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
$separator |
string to place between hours and minutes (":" by default)
|
|
#
|
public
|
getPaddedUnit(string $unit, int $length = 2, string $padString = '0', int $padType = 0): string
Returns a unit of the instance padded with 0 by default or any other string if specified.
Returns a unit of the instance padded with 0 by default or any other string if specified.
Parameters
$unit |
Carbon unit name
|
$length |
Length of the output (2 by default)
|
$padString |
String to use for padding ("0" by default)
|
$padType |
Side(s) to pad (STR_PAD_LEFT by default)
|
|
#
|
public
|
getPreciseTimestamp(int $precision = 6): float
Returns a timestamp rounded with the given precision (6 by default).
Returns a timestamp rounded with the given precision (6 by default).
|
#
|
public
|
getSettings(): array
Returns current local settings.
Returns current local settings.
|
#
|
public
static
|
getTestNow(): Closure|static
Get the Carbon instance (real or mock) to be returned when a "now"
instance is created.
Get the Carbon instance (real or mock) to be returned when a "now"
instance is created.
Returns
the current instance used for testing
|
#
|
public
static
|
getTimeFormatByPrecision(string $unitPrecision): string
Return a format from H:i to H:i:s.u according to given unit precision.
Return a format from H:i to H:i:s.u according to given unit precision.
Parameters
$unitPrecision |
"minute", "second", "millisecond" or "microsecond"
|
|
#
|
public
|
getTimestampMs(): int
Returns the timestamp with millisecond precision.
Returns the timestamp with millisecond precision.
|
#
|
public
|
getTranslatedDayName(string|null $context = null, string $keySuffix = '', string|null $defaultValue = null): string
Get the translation of the current week day name (with context for languages with multiple forms).
Get the translation of the current week day name (with context for languages with multiple forms).
Parameters
$context |
whole format string
|
$keySuffix |
"", "_short" or "_min"
|
$defaultValue |
default value if translation missing
|
|
#
|
public
|
getTranslatedMinDayName(string|null $context = null): string
Get the translation of the current abbreviated week day name (with context for languages with multiple forms).
Get the translation of the current abbreviated week day name (with context for languages with multiple forms).
Parameters
$context |
whole format string
|
|
#
|
public
|
getTranslatedMonthName(string|null $context = null, string $keySuffix = '', string|null $defaultValue = null): string
Get the translation of the current month day name (with context for languages with multiple forms).
Get the translation of the current month day name (with context for languages with multiple forms).
Parameters
$context |
whole format string
|
$keySuffix |
"" or "_short"
|
$defaultValue |
default value if translation missing
|
|
#
|
public
|
getTranslatedShortDayName(string|null $context = null): string
Get the translation of the current short week day name (with context for languages with multiple forms).
Get the translation of the current short week day name (with context for languages with multiple forms).
Parameters
$context |
whole format string
|
|
#
|
public
|
getTranslatedShortMonthName(string|null $context = null): string
Get the translation of the current short month day name (with context for languages with multiple forms).
Get the translation of the current short month day name (with context for languages with multiple forms).
Parameters
$context |
whole format string
|
|
#
|
public
|
getTranslationMessage(
string $key,
string|null $locale = null,
string|null $default = null,
TranslatorInterface $translator = null,
): string
Returns raw translation message for a given key.
Returns raw translation message for a given key.
Parameters
$key |
key to find
|
$locale |
current locale used if null
|
$default |
default value if translation returns the key
|
$translator |
an optional translator to use
|
|
#
|
public
static
|
getTranslationMessageWith(
TranslatorInterface $translator,
string $key,
string|null $locale = null,
string|null $default = null,
): string
Returns raw translation message for a given key.
Returns raw translation message for a given key.
Parameters
$translator |
the translator to use
|
$key |
key to find
|
$locale |
current locale used if null
|
$default |
default value if translation returns the key
|
|
#
|
public
static
|
getTranslator(): TranslatorInterface
Get the default translator instance in use.
Get the default translator instance in use.
|
#
|
public
static
|
getWeekEndsAt(): int
Get the last day of week
|
#
|
public
static
|
getWeekStartsAt(): int
Get the first day of week
Get the first day of week
|
#
|
public
static
|
getWeekendDays(): array
Get weekend days
|
#
|
public
|
greaterThan(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is greater (after) than another
Determines if the instance is greater (after) than another
|
#
|
public
|
greaterThanOrEqualTo(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is greater (after) than or equal to another
Determines if the instance is greater (after) than or equal to another
|
#
|
public
|
gt(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is greater (after) than another
Determines if the instance is greater (after) than another
|
#
|
public
|
gte(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is greater (after) than or equal to another
Determines if the instance is greater (after) than or equal to another
|
#
|
public
static
|
hasFormat(string $date, string $format): bool
Checks if the (date)time string is in a given format.
Checks if the (date)time string is in a given format.
|
#
|
public
static
|
hasFormatWithModifiers(string $date, string $format): bool
Checks if the (date)time string is in a given format.
Checks if the (date)time string is in a given format.
|
#
|
public
|
hasLocalMacro(string $name): bool
Checks if macro is registered globally or locally.
Checks if macro is registered globally or locally.
|
#
|
public
|
hasLocalTranslator(): bool
Return true if the current instance has its own translator.
Return true if the current instance has its own translator.
|
#
|
public
static
|
hasMacro(string $name): bool
Checks if macro is registered globally.
Checks if macro is registered globally.
|
#
|
public
static
|
hasRelativeKeywords(string $time): bool
Determine if a time string will produce a relative date.
Determine if a time string will produce a relative date.
Returns
true if time match a relative date, false if absolute or invalid time string
|
#
|
public
static
|
hasTestNow(): bool
Determine if there is a valid test instance set. A valid test instance
is anything that is not null.
Determine if there is a valid test instance set. A valid test instance
is anything that is not null.
Returns
true if there is a test instance, otherwise false
|
#
|
public
static
|
instance(DateTimeInterface $date): static
Create a Carbon instance from a DateTime one.
Create a Carbon instance from a DateTime one.
|
#
|
public
|
is(string $tester): bool
Returns true if the current date matches the given string.
Returns true if the current date matches the given string.
Parameters
$tester |
day name, month name, hour, date, etc. as string
|
|
#
|
public
|
isAfter(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is greater (after) than another
Determines if the instance is greater (after) than another
|
#
|
public
|
isBefore(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is less (before) than another
Determines if the instance is less (before) than another
|
#
|
public
|
isBetween(Carbon|DateTimeInterface|mixed $date1, Carbon|DateTimeInterface|mixed $date2, bool $equal = true): bool
Determines if the instance is between two others
Determines if the instance is between two others
Parameters
$equal |
Indicates if an equal to comparison should be done
|
|
#
|
public
|
isBirthday(Carbon|DateTimeInterface|null $date = null): bool
Check if its the birthday. Compares the date/month values of the two dates.
Check if its the birthday. Compares the date/month values of the two dates.
Parameters
$date |
The instance to compare with or null to use current day.
|
|
#
|
public
|
isCurrentUnit(string $unit): bool
Determines if the instance is in the current unit given.
Determines if the instance is in the current unit given.
Parameters
Throws
|
#
|
public
|
isDayOfWeek(int $dayOfWeek): bool
Checks if this day is a specific day of the week.
Checks if this day is a specific day of the week.
|
#
|
public
|
isEndOfDay(bool $checkMicroseconds = false): bool
Check if the instance is end of day.
Check if the instance is end of day.
Parameters
$checkMicroseconds |
check time at microseconds precision
|
|
#
|
public
|
isEndOfTime(): bool
Returns true if the date was created using CarbonImmutable::endOfTime()
Returns true if the date was created using CarbonImmutable::endOfTime()
|
#
|
public
|
isFuture(): bool
Determines if the instance is in the future, ie. greater (after) than now.
Determines if the instance is in the future, ie. greater (after) than now.
|
#
|
public
static
|
isImmutable(): bool
Returns true if the current class/instance is immutable.
Returns true if the current class/instance is immutable.
|
#
|
public
|
isLastOfMonth(): bool
Check if today is the last day of the Month
Check if today is the last day of the Month
|
#
|
public
|
isLeapYear(): bool
Determines if the instance is a leap year.
Determines if the instance is a leap year.
|
#
|
public
|
isLongYear(): bool
Determines if the instance is a long year
Determines if the instance is a long year
|
#
|
public
|
isMidday(): bool
Check if the instance is midday.
Check if the instance is midday.
|
#
|
public
|
isMidnight(): bool
Check if the instance is start of day / midnight.
Check if the instance is start of day / midnight.
|
#
|
public
static
|
isModifiableUnit(string $unit): bool
Returns true if a property can be changed via setter.
Returns true if a property can be changed via setter.
|
#
|
public
static
|
isMutable(): bool
Returns true if the current class/instance is mutable.
Returns true if the current class/instance is mutable.
Implemented by
|
#
|
public
|
isPast(): bool
Determines if the instance is in the past, ie. less (before) than now.
Determines if the instance is in the past, ie. less (before) than now.
|
#
|
public
|
isSameAs(string $format, Carbon|DateTimeInterface|string|null $date = null): bool
Compares the formatted values of the two dates.
Compares the formatted values of the two dates.
Parameters
$format |
date formats to compare.
|
$date |
instance to compare with or null to use current day.
|
|
#
|
public
|
isSameMonth(Carbon|DateTimeInterface|null $date = null, bool $ofSameYear = true): bool
Checks if the passed in date is in the same month as the instance´s month.
Checks if the passed in date is in the same month as the instance´s month.
Parameters
$date |
The instance to compare with or null to use the current date.
|
$ofSameYear |
Check if it is the same month in the same year.
|
|
#
|
public
|
isSameQuarter(Carbon|DateTimeInterface|string|null $date = null, bool $ofSameYear = true): bool
Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).
Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).
Parameters
$date |
The instance to compare with or null to use current day.
|
$ofSameYear |
Check if it is the same month in the same year.
|
|
#
|
public
|
isSameUnit(string $unit, Carbon|DateTimeInterface|null $date = null): bool
Determines if the instance is in the current unit given.
Determines if the instance is in the current unit given.
Parameters
$unit |
singular unit string
|
$date |
instance to compare with or null to use current day.
|
Throws
|
#
|
public
|
isStartOfDay(bool $checkMicroseconds = false): bool
Check if the instance is start of day / midnight.
Check if the instance is start of day / midnight.
Parameters
$checkMicroseconds |
check time at microseconds precision
|
|
#
|
public
|
isStartOfTime(): bool
Returns true if the date was created using CarbonImmutable::startOfTime()
Returns true if the date was created using CarbonImmutable::startOfTime()
|
#
|
public
static
|
isStrictModeEnabled(): bool
Returns true if the strict mode is globally in use, false else.
(It can be overridden in specific instances.)
Returns true if the strict mode is globally in use, false else.
(It can be overridden in specific instances.)
|
#
|
public
|
isToday(): bool
Determines if the instance is today.
Determines if the instance is today.
|
#
|
public
|
isTomorrow(): bool
Determines if the instance is tomorrow.
Determines if the instance is tomorrow.
|
#
|
public
|
isWeekday(): bool
Determines if the instance is a weekday.
Determines if the instance is a weekday.
|
#
|
public
|
isWeekend(): bool
Determines if the instance is a weekend day.
Determines if the instance is a weekend day.
|
#
|
public
|
isYesterday(): bool
Determines if the instance is yesterday.
Determines if the instance is yesterday.
|
#
|
public
|
isoFormat(string $format, string|null $originalFormat = null): string
Format in the current language using ISO replacement patterns.
Format in the current language using ISO replacement patterns.
Parameters
$originalFormat |
provide context if a chunk has been passed alone
|
|
#
|
public
|
isoWeek(int|null $week = null, int|null $dayOfWeek = null, int|null $dayOfYear = null): int|static
Get/set the week number using given first day of week and first
day of year included in the first week. Or use ISO…
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.
|
#
|
public
|
isoWeekYear(int|null $year = null, int|null $dayOfWeek = null, int|null $dayOfYear = null): int|static
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…
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
$year |
if null, act as a getter, if not null, set the year and return current instance.
|
$dayOfWeek |
first date of week from 0 (Sunday) to 6 (Saturday)
|
$dayOfYear |
first day of year included in the week #1
|
|
#
|
public
|
isoWeekday(int|null $value = null): static|int
Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
Parameters
$value |
new value for weekday if using as setter.
|
|
#
|
public
|
isoWeeksInYear(int|null $dayOfWeek = null, int|null $dayOfYear = null): int
Get the number of weeks of the current week-year using given first day of week and first
day of year included in the…
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
$dayOfWeek |
first date of week from 0 (Sunday) to 6 (Saturday)
|
$dayOfYear |
first day of year included in the week #1
|
|
#
|
public
|
jsonSerialize(): array|string
Prepare the object for JSON serialization.
Prepare the object for JSON serialization.
|
#
|
public
|
lastOfMonth(int|null $dayOfWeek = null): static
Modify to the last occurrence of a given day of the week
in the current month. If no dayOfWeek is provided, modify to…
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.
|
#
|
public
|
lastOfQuarter(int|null $dayOfWeek = null): static
Modify to the last occurrence of a given day of the week
in the current quarter. If no dayOfWeek is provided, modify to…
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
$dayOfWeek |
day of the week default null
|
|
#
|
public
|
lastOfYear(int|null $dayOfWeek = null): static
Modify to the last occurrence of a given day of the week
in the current year. If no dayOfWeek is provided, modify to…
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
$dayOfWeek |
day of the week default null
|
|
#
|
public
|
lessThan(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is less (before) than another
Determines if the instance is less (before) than another
|
#
|
public
|
lessThanOrEqualTo(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is less (before) or equal to another
Determines if the instance is less (before) or equal to another
|
#
|
public
|
locale(string|null $locale = null, string ...$fallbackLocales): $this|string
Get/set the locale for the current instance.
Get/set the locale for the current instance.
|
#
|
public
static
|
localeHasDiffOneDayWords(string $locale): bool
Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).…
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
|
#
|
public
static
|
localeHasDiffSyntax(string $locale): bool
Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).…
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
|
#
|
public
static
|
localeHasDiffTwoDayWords(string $locale): bool
Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after…
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
|
#
|
public
static
|
localeHasPeriodSyntax(string $locale): bool
Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X)…
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
|
#
|
public
static
|
localeHasShortUnits(string $locale): bool
Returns true if the given locale is internally supported and has short-units support.
Support is considered enabled if…
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
|
#
|
public
|
lt(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is less (before) than another
Determines if the instance is less (before) than another
|
#
|
public
|
lte(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is less (before) or equal to another
Determines if the instance is less (before) or equal to another
|
#
|
public
static
|
macro(string $name, object|callable $macro): void
Register a custom macro.
|
#
|
public
static
|
make(mixed $var): static|null
Make a Carbon instance from given variable if possible.
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.
Throws
|
#
|
public
|
max(Carbon|DateTimeInterface|mixed $date = null): static
Get the maximum instance between a given instance (default now) and the current instance.
Get the maximum instance between a given instance (default now) and the current instance.
|
#
|
public
static
|
maxValue(): static
Create a Carbon instance for the greatest supported date.
Create a Carbon instance for the greatest supported date.
|
#
|
public
|
maximum(Carbon|DateTimeInterface|mixed $date = null): static
Get the maximum instance between a given instance (default now) and the current instance.
Get the maximum instance between a given instance (default now) and the current instance.
|
#
|
public
|
meridiem(bool $isLower = false): string
Return the meridiem of the current time in the current locale.
Return the meridiem of the current time in the current locale.
Parameters
$isLower |
if true, returns lowercase variant if available in the current locale.
|
|
#
|
public
|
midDay(): static
Modify to midday, default to self::$midDayAt
Modify to midday, default to self::$midDayAt
|
#
|
public
|
min(Carbon|DateTimeInterface|mixed $date = null): static
Get the minimum instance between a given instance (default now) and the current instance.
Get the minimum instance between a given instance (default now) and the current instance.
|
#
|
public
static
|
minValue(): static
Create a Carbon instance for the lowest supported date.
Create a Carbon instance for the lowest supported date.
|
#
|
public
|
minimum(Carbon|DateTimeInterface|mixed $date = null): static
Get the minimum instance between a given instance (default now) and the current instance.
Get the minimum instance between a given instance (default now) and the current instance.
|
#
|
public
static
|
mixin(object|string $mixin): void
Mix another object into the class.
Mix another object into the class.
Throws
|
#
|
public
|
modify($modify): static|false
Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else.
Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else.
|
#
|
public
|
ne(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is not equal to another
Determines if the instance is not equal to another
|
#
|
public
|
next(string|int|null $modifier = null): static|false
Modify to the next occurrence of a given modifier such as a day of
the week. If no modifier is provided, modify to the…
Modify to the next occurrence of a given modifier such as a day of
the week. If no modifier is provided, modify to the next occurrence
of the current day of the week. Use the supplied constants
to indicate the desired dayOfWeek, ex. static::MONDAY.
|
#
|
public
|
nextWeekday(): static
Go forward to the next weekday.
Go forward to the next weekday.
|
#
|
public
|
nextWeekendDay(): static
Go forward to the next weekend day.
Go forward to the next weekend day.
|
#
|
public
|
notEqualTo(Carbon|DateTimeInterface|mixed $date): bool
Determines if the instance is not equal to another
Determines if the instance is not equal to another
|
#
|
public
static
|
now(DateTimeZone|string|null $tz = null): static
Get a Carbon instance for the current date and time.
Get a Carbon instance for the current date and time.
|
#
|
public
|
nowWithSameTz(): static
Returns a present instance in the same timezone.
Returns a present instance in the same timezone.
|
#
|
public
|
nthOfMonth(int $nth, int $dayOfWeek): mixed
Modify to the given occurrence of a given day of the week
in the current month. If the calculated occurrence is outside…
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.
|
#
|
public
|
nthOfQuarter(int $nth, int $dayOfWeek): mixed
Modify to the given occurrence of a given day of the week
in the current quarter. If the calculated occurrence is…
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.
|
#
|
public
|
nthOfYear(int $nth, int $dayOfWeek): mixed
Modify to the given occurrence of a given day of the week
in the current year. If the calculated occurrence is outside…
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.
|
#
|
public
|
ordinal(string $key, string|null $period = null): string
Return a property with its ordinal.
Return a property with its ordinal.
|
#
|
public
static
|
parse(string|DateTimeInterface|null $time = null, DateTimeZone|string|null $tz = null): static
Create a carbon instance from a string.
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().
Throws
|
#
|
public
static
|
parseFromLocale(string $time, string|null $locale = null, DateTimeZone|string|null $tz = null): static
Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).
Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).
Parameters
$time |
date/time string in the given language (may also contain English).
|
$locale |
if locale is null or not specified, current global locale will be
used instead.
|
$tz |
optional timezone for the new instance.
|
Throws
|
#
|
public
static
|
pluralUnit(string $unit): string
Returns standardized plural of a given singular/plural unit name (in English).
Returns standardized plural of a given singular/plural unit name (in English).
|
#
|
public
|
previous(string|int|null $modifier = null): static|false
Modify to the previous occurrence of a given modifier such as a day of
the week. If no dayOfWeek is provided, modify to…
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.
|
#
|
public
|
previousWeekday(): static
Go backward to the previous weekday.
Go backward to the previous weekday.
|
#
|
public
|
previousWeekendDay(): static
Go backward to the previous weekend day.
Go backward to the previous weekend day.
|
#
|
public
|
range(
DateTimeInterface|Carbon|CarbonImmutable|null $end = null,
int|DateInterval|string|null $interval = null,
string|null $unit = null,
): CarbonPeriod
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
Parameters
$end |
period end date
|
$interval |
period default interval or number of the given $unit
|
$unit |
if specified, $interval must be an integer
|
|
#
|
public
|
rawAdd(DateInterval $interval): static
Call native PHP DateTime/DateTimeImmutable add() method.
Call native PHP DateTime/DateTimeImmutable add() method.
|
#
|
public
static
|
rawCreateFromFormat(string $format, string $time, DateTimeZone|string|false|null $tz = null): static|false
Create a Carbon instance from a specific format.
Create a Carbon instance from a specific format.
Parameters
Throws
|
#
|
public
|
rawFormat(string $format): string
|
#
|
public
static
|
rawParse(string|DateTimeInterface|null $time = null, DateTimeZone|string|null $tz = null): static
Create a carbon instance from a string.
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().
Throws
|
#
|
public
|
rawSub(DateInterval $interval): static
Call native PHP DateTime/DateTimeImmutable sub() method.
Call native PHP DateTime/DateTimeImmutable sub() method.
|
#
|
public
static
|
resetMacros()
Remove all macros and generic macros.
Remove all macros and generic macros.
|
#
|
public
static
|
resetMonthsOverflow(): void
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).
|
#
|
public
static
|
resetToStringFormat(): void
Reset the format used to the default when type juggling a Carbon instance to a string
Reset the format used to the default when type juggling a Carbon instance to a string
|
#
|
public
static
|
resetYearsOverflow(): void
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).
|
#
|
public
|
round(float|int|string|DateInterval|null $precision = 1, string $function = 'round'): CarbonInterface
Round the current instance second with given precision if specified.
Round the current instance second with given precision if specified.
|
#
|
public
|
roundUnit(string $unit, float|int $precision = 1, string $function = 'round'): CarbonInterface
Round the current instance at the given unit with given precision if specified and the given function.
Round the current instance at the given unit with given precision if specified and the given function.
|
#
|
public
|
roundWeek(int $weekStartsAt = null): CarbonInterface
Round the current instance week.
Round the current instance week.
Parameters
$weekStartsAt |
optional start allow you to specify the day of week to use to start the week
|
|
#
|
public
|
secondsSinceMidnight(): int
The number of seconds since midnight.
The number of seconds since midnight.
|
#
|
public
|
secondsUntilEndOfDay(): int
The number of seconds until 23:59:59.
The number of seconds until 23:59:59.
|
#
|
public
|
serialize(): string
Return a serialized string of the instance.
Return a serialized string of the instance.
|
#
|
public
static
|
serializeUsing(callable $callback): void
Deprecated
To avoid conflict between different third-party libraries, static setters should not be used.
You should rather transform Carbon object before the serialization.
|
#
|
public
|
set(string|array $name, string|int|DateTimeZone $value = null): $this
Set a part of the Carbon object
Set a part of the Carbon object
Throws
|
#
|
public
|
setDate(int $year, int $month, int $day): static
Set the date with gregorian year, month and day numbers.
Set the date with gregorian year, month and day numbers.
|
#
|
public
|
setDateFrom(Carbon|DateTimeInterface $date = null): static
Set the year, month, and date for this instance to that of the passed instance.
Set the year, month, and date for this instance to that of the passed instance.
Parameters
|
#
|
public
|
setDateTime(int $year, int $month, int $day, int $hour, int $minute, int $second = 0, int $microseconds = 0): static
Set the date and time all together.
Set the date and time all together.
|
#
|
public
|
setDateTimeFrom(Carbon|DateTimeInterface $date = null): static
Set the date and time for this instance to that of the passed instance.
Set the date and time for this instance to that of the passed instance.
|
#
|
public
|
setDaysFromStartOfWeek(int $numberOfDays, int|null $weekStartsAt = null): static
Set the day (keeping the current time) to the start of the week + the number of days passed as the first
parameter.…
Set the day (keeping the current time) to the start of the week + the number of days passed as the first
parameter. First day of week is driven by the locale unless explicitly set with the second parameter.
Parameters
$numberOfDays |
number of days to add after the start of the current week
|
$weekStartsAt |
optional start allow you to specify the day of week to use to start the week,
if not provided, start of week is inferred from the locale
(Sunday for en_US, Monday for de_DE, etc.)
|
|
#
|
public
static
|
setFallbackLocale(string $locale)
Set the fallback locale.
|
#
|
public
static
|
setHumanDiffOptions(int $humanDiffOptions)
Deprecated
To avoid conflict between different third-party libraries, static setters should not be used.
You should rather use the ->settings() method.
|
#
|
public
|
setISODate(int $year, int $week, int $day = 1): static
Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
|
#
|
public
|
setLocalTranslator(TranslatorInterface $translator): $this
Set the translator for the current instance.
Set the translator for the current instance.
|
#
|
public
static
|
setLocale(string $locale): bool
Set the current translator locale and indicate if the source locale file exists.
Pass 'auto' as locale to use closest…
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
|
#
|
public
static
|
setMidDayAt(int $hour): void
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)
Parameters
|
#
|
public
static
|
setTestNow(DateTimeInterface|Closure|static|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…
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
$testNow |
real or mock Carbon instance
|
Implemented by
|
#
|
public
static
|
setTestNowAndTimezone(DateTimeInterface|Closure|static|string|false|null $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…
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 |
real or mock Carbon instance
|
|
#
|
public
|
setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0): static
Resets the current time of the DateTime object to a different time.
Resets the current time of the DateTime object to a different time.
|
#
|
public
|
setTimeFrom(Carbon|DateTimeInterface $date = null): static
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
Parameters
|
#
|
public
|
setTimeFromTimeString(string $time): static
Set the time by time string.
Set the time by time string.
|
#
|
public
|
setTimestamp(float|int|string $unixTimestamp): static
Set the instance's timestamp.
Set the instance's timestamp.
Timestamp input can be given as int, float or a string containing one or more numbers.
|
#
|
public
|
setTimezone(DateTimeZone|string $value): static
Set the instance's timezone from a string or object.
Set the instance's timezone from a string or object.
|
#
|
public
static
|
setToStringFormat(string|Closure|null $format): void
Deprecated
To avoid conflict between different third-party libraries, static setters should not be used.
You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
use other method or custom format passed to format() method if you need to dump another string
format.
|
#
|
public
static
|
setTranslator(TranslatorInterface $translator): void
Set the default translator instance to use.
Set the default translator instance to use.
|
#
|
public
|
setUnit(string $unit, int $value = null): static
Set specified unit to new given value.
Set specified unit to new given value.
Parameters
$unit |
year, month, day, hour, minute, second or microsecond
|
$value |
new value for given unit
|
|
#
|
public
|
setUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static
Set any unit to a new value without overflowing current other unit given.
Set any unit to a new value without overflowing current other unit given.
Parameters
$valueUnit |
unit name to modify
|
$value |
new value for the input unit
|
$overflowUnit |
unit name to not overflow
|
|
#
|
public
static
|
setUtf8(bool $utf8)
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.
|
#
|
public
static
|
setWeekEndsAt(int|string $day): void
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.
Parameters
$day |
week end day (or 'auto' to get the day before the first day of week
from Carbon::getLocale() culture).
|
|
#
|
public
static
|
setWeekStartsAt(int|string $day): void
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.
Parameters
$day |
week start day (or 'auto' to get the first day of week from Carbon::getLocale() culture).
|
|
#
|
public
static
|
setWeekendDays(array $days): void
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:
|
#
|
public
|
settings(array $settings): $this|static
Set specific options.
- strictMode: true|false|null
- monthOverflow: true|false|null
- yearOverflow: true|false|null…
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
|
#
|
public
|
shiftTimezone(DateTimeZone|string $value): static
Set the instance's timezone from a string or object and add/subtract the offset difference.
Set the instance's timezone from a string or object and add/subtract the offset difference.
|
#
|
public
static
|
shouldOverflowMonths(): bool
Get the month overflow global behavior (can be overridden in specific instances).
Get the month overflow global behavior (can be overridden in specific instances).
|
#
|
public
static
|
shouldOverflowYears(): bool
Get the month overflow global behavior (can be overridden in specific instances).
Get the month overflow global behavior (can be overridden in specific instances).
|
#
|
public
|
since($other = null, $syntax = null, $short = false, $parts = 1, $options = null)
|
#
|
public
static
|
singularUnit(string $unit): string
Returns standardized singular of a given singular/plural unit name (in English).
Returns standardized singular of a given singular/plural unit name (in English).
|
#
|
public
|
startOf(string $unit, array<int, mixed> ...$params): static
Modify to start of current given unit.
Modify to start of current given unit.
|
#
|
public
|
startOfCentury(): static
Resets the date to the first day of the century and the time to 00:00:00
Resets the date to the first day of the century and the time to 00:00:00
|
#
|
public
|
startOfDay(): static
Resets the time to 00:00:00 start of day
Resets the time to 00:00:00 start of day
|
#
|
public
|
startOfDecade(): static
Resets the date to the first day of the decade and the time to 00:00:00
Resets the date to the first day of the decade and the time to 00:00:00
|
#
|
public
|
startOfHour(): static
Modify to start of current hour, minutes and seconds become 0
Modify to start of current hour, minutes and seconds become 0
|
#
|
public
|
startOfMillennium(): static
Resets the date to the first day of the millennium and the time to 00:00:00
Resets the date to the first day of the millennium and the time to 00:00:00
|
#
|
public
|
startOfMinute(): static
Modify to start of current minute, seconds become 0
Modify to start of current minute, seconds become 0
|
#
|
public
|
startOfMonth(): static
Resets the date to the first day of the month and the time to 00:00:00
Resets the date to the first day of the month and the time to 00:00:00
|
#
|
public
|
startOfQuarter(): static
Resets the date to the first day of the quarter and the time to 00:00:00
Resets the date to the first day of the quarter and the time to 00:00:00
|
#
|
public
|
startOfSecond(): static
Modify to start of current second, microseconds become 0
Modify to start of current second, microseconds become 0
|
#
|
public
|
startOfWeek(int $weekStartsAt = null): static
Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
Parameters
$weekStartsAt |
optional start allow you to specify the day of week to use to start the week
|
|
#
|
public
|
startOfYear(): static
Resets the date to the first day of the year and the time to 00:00:00
Resets the date to the first day of the year and the time to 00:00:00
|
#
|
public
|
sub(string|DateInterval|Closure|CarbonConverterInterface $unit, int $value = 1, bool|null $overflow = null): static
Subtract given units or interval to the current instance.
Subtract given units or interval to the current instance.
|
#
|
public
|
subRealUnit($unit, $value = 1)
|
#
|
public
|
subUnit(string $unit, int $value = 1, bool|null $overflow = null): static
Subtract given units to the current instance.
Subtract given units to the current instance.
|
#
|
public
|
subUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static
Subtract any unit to a new value without overflowing current other unit given.
Subtract any unit to a new value without overflowing current other unit given.
Parameters
$valueUnit |
unit name to modify
|
$value |
amount to subtract to the input unit
|
$overflowUnit |
unit name to not overflow
|
|
#
|
public
|
subtract(string|DateInterval $unit, int $value = 1, bool|null $overflow = null): static
Subtract given units or interval to the current instance.
Subtract given units or interval to the current instance.
|
#
|
public
|
timespan($other = null, $timezone = null): string
Get the difference in a human readable format in the current locale from current instance to an other
instance given …
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).
|
#
|
public
|
timestamp(float|int|string $unixTimestamp): static
Set the instance's timestamp.
Set the instance's timestamp.
Timestamp input can be given as int, float or a string containing one or more numbers.
|
#
|
public
|
timezone(DateTimeZone|string $value): static
|
#
|
public
|
to(
Carbon|DateTimeInterface|string|array|null $other = null,
int|array $syntax = null,
bool $short = false,
int $parts = 1,
int $options = null,
): string
Get the difference in a human readable format in the current locale from an other
instance given (or now if null given)…
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
$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.
|
$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
|
$short |
displays short format of time units
|
$parts |
maximum number of parts to display (default value: 1: single unit)
|
$options |
human diff options
|
|
#
|
public
|
toArray(): array
Get default array representation.
Get default array representation.
|
#
|
public
|
toAtomString(): string
Format the instance as ATOM
Format the instance as ATOM
|
#
|
public
|
toCookieString(): string
Format the instance as COOKIE
Format the instance as COOKIE
|
#
|
public
|
toDate(): DateTime
|
#
|
public
|
toDateString(): string
Format the instance as date
Format the instance as date
|
#
|
public
|
toDateTime(): DateTime
Return native DateTime PHP object matching the current instance.
Return native DateTime PHP object matching the current instance.
|
#
|
public
|
toDateTimeImmutable(): DateTimeImmutable
Return native toDateTimeImmutable PHP object matching the current instance.
Return native toDateTimeImmutable PHP object matching the current instance.
|
#
|
public
|
toDateTimeLocalString(string $unitPrecision = 'second'): string
Format the instance as date and time T-separated with no timezone
Format the instance as date and time T-separated with no timezone
|
#
|
public
|
toDateTimeString(string $unitPrecision = 'second'): string
Format the instance as date and time
Format the instance as date and time
|
#
|
public
|
toDayDateTimeString(): string
Format the instance with day, date and time
Format the instance with day, date and time
|
#
|
public
|
toFormattedDateString(): string
Format the instance as a readable date
Format the instance as a readable date
|
#
|
public
|
toFormattedDayDateString(): string
Format the instance with the day, and a readable date
Format the instance with the day, and a readable date
|
#
|
public
|
toISOString(bool $keepOffset = false): null|string
Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept:
1977-04-22T01:00:00…
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
$keepOffset |
Pass true to keep the date offset. Else forced to UTC.
|
|
#
|
public
|
toImmutable(): CarbonImmutable
Return a immutable copy of the instance.
Return a immutable copy of the instance.
|
#
|
public
|
toIso8601String(): string
Format the instance as ISO8601
Format the instance as ISO8601
|
#
|
public
|
toIso8601ZuluString(string $unitPrecision = 'second'): string
Convert the instance to UTC and return as Zulu ISO8601
Convert the instance to UTC and return as Zulu ISO8601
|
#
|
public
|
toJSON(): null|string
Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone.
Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone.
|
#
|
public
|
toMutable(): Carbon
Return a mutable copy of the instance.
Return a mutable copy of the instance.
|
#
|
public
|
toNow(int|array $syntax = null, bool $short = false, int $parts = 1, int $options = null): string
Get the difference in a human readable format in the current locale from an other
instance given to now
Get the difference in a human readable format in the current locale from an other
instance given to now
Parameters
$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
|
$short |
displays short format of time units
|
$parts |
maximum number of parts to display (default value: 1: single part)
|
$options |
human diff options
|
|
#
|
public
|
toObject(): object
Get default object representation.
Get default object representation.
|
#
|
public
|
toPeriod(
DateTimeInterface|Carbon|CarbonImmutable|int|null $end = null,
int|DateInterval|string|null $interval = null,
string|null $unit = null,
): CarbonPeriod
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
Parameters
$end |
period end date or recurrences count if int
|
$interval |
period default interval or number of the given $unit
|
$unit |
if specified, $interval must be an integer
|
|
#
|
public
|
toRfc1036String(): string
Format the instance as RFC1036
Format the instance as RFC1036
|
#
|
public
|
toRfc1123String(): string
Format the instance as RFC1123
Format the instance as RFC1123
|
#
|
public
|
toRfc2822String(): string
Format the instance as RFC2822
Format the instance as RFC2822
|
#
|
public
|
toRfc3339String(bool $extended = false): string
Format the instance as RFC3339
Format the instance as RFC3339
|
#
|
public
|
toRfc7231String(): string
Format the instance as RFC7231
Format the instance as RFC7231
|
#
|
public
|
toRfc822String(): string
Format the instance as RFC822
Format the instance as RFC822
|
#
|
public
|
toRfc850String(): string
Format the instance as RFC850
Format the instance as RFC850
|
#
|
public
|
toRssString(): string
Format the instance as RSS
Format the instance as RSS
|
#
|
public
|
toString(): string
Returns english human readable complete date string.
Returns english human readable complete date string.
|
#
|
public
|
toTimeString(string $unitPrecision = 'second'): string
Format the instance as time
Format the instance as time
|
#
|
public
|
toW3cString(): string
Format the instance as W3C
Format the instance as W3C
|
#
|
public
static
|
today(DateTimeZone|string|null $tz = null): static
Create a Carbon instance for today.
Create a Carbon instance for today.
|
#
|
public
static
|
tomorrow(DateTimeZone|string|null $tz = null): static
Create a Carbon instance for tomorrow.
Create a Carbon instance for tomorrow.
|
#
|
public
|
translate(
string $key,
array $parameters = [],
string|int|float|null $number = null,
TranslatorInterface|null $translator = null,
bool $altNumbers = false,
): string
Translate using translation string or callback available.
Translate using translation string or callback available.
|
#
|
public
|
translateNumber(int $number): string
Returns the alternative number for a given integer if available in the current locale.
Returns the alternative number for a given integer if available in the current locale.
|
#
|
public
static
|
translateTimeString(
string $timeString,
string|null $from = null,
string|null $to = null,
int $mode = self::TRANSLATE_ALL,
): string
Translate a time string from a locale to an other.
Translate a time string from a locale to an other.
Parameters
$timeString |
date/time/duration string to translate (may also contain English)
|
$from |
input locale of the $timeString parameter (Carbon::getLocale() by default)
|
$to |
output locale of the result returned ("en" by default)
|
$mode |
specify what to translate with options:
- self::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
|
|
#
|
public
|
translateTimeStringTo(string $timeString, string|null $to = null): string
Translate a time string from the current locale (`$date->locale()`) to an other.
Translate a time string from the current locale ($date->locale() ) to an other.
Parameters
$timeString |
time string to translate
|
$to |
output locale of the result returned ("en" by default)
|
|
#
|
public
static
|
translateWith(TranslatorInterface $translator, string $key, array $parameters = [], null $number = null): string
Translate using translation string or callback available.
Translate using translation string or callback available.
|
#
|
public
|
translatedFormat(string $format): string
Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php)
but…
|
#
|
public
|
tz(DateTimeZone|string $value = null): static|string
Set the timezone or returns the timezone name if no arguments passed.
Set the timezone or returns the timezone name if no arguments passed.
|
#
|
public
|
unix(): int
|
#
|
public
|
until(
Carbon|DateTimeInterface|string|array|null $other = null,
int|array $syntax = null,
bool $short = false,
int $parts = 1,
int $options = null,
): string
Parameters
$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.
|
$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
|
$short |
displays short format of time units
|
$parts |
maximum number of parts to display (default value: 1: single unit)
|
$options |
human diff options
|
|
#
|
public
static
|
useMonthsOverflow(bool $monthsOverflow = true): void
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).
|
#
|
public
static
|
useStrictMode(bool $strictModeEnabled = true)
Deprecated
To avoid conflict between different third-party libraries, static setters should not be used.
You should rather use the ->settings() method.
|
#
|
public
static
|
useYearsOverflow(bool $yearsOverflow = true): void
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).
|
#
|
public
|
utc(): static
Set the instance's timezone to UTC.
Set the instance's timezone to UTC.
|
#
|
public
|
utcOffset(int|null $minuteOffset = null): int|static
Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
|
#
|
public
|
valueOf(): float
Returns the milliseconds timestamps used amongst other by Date javascript objects.
Returns the milliseconds timestamps used amongst other by Date javascript objects.
|
#
|
public
|
week(int|null $week = null, int|null $dayOfWeek = null, int|null $dayOfYear = null): int|static
Get/set the week number using given first day of week and first
day of year included in the first week. Or use US…
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).
|
#
|
public
|
weekYear(int|null $year = null, int|null $dayOfWeek = null, int|null $dayOfYear = null): int|static
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…
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
$year |
if null, act as a getter, if not null, set the year and return current instance.
|
$dayOfWeek |
first date of week from 0 (Sunday) to 6 (Saturday)
|
$dayOfYear |
first day of year included in the week #1
|
|
#
|
public
|
weekday(int|null $value = null): static|int
Get/set the weekday from 0 (Sunday) to 6 (Saturday).
Get/set the weekday from 0 (Sunday) to 6 (Saturday).
Parameters
$value |
new value for weekday if using as setter.
|
|
#
|
public
|
weeksInYear(int|null $dayOfWeek = null, int|null $dayOfYear = null): int
Get the number of weeks of the current week-year using given first day of week and first
day of year included in the…
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
$dayOfWeek |
first date of week from 0 (Sunday) to 6 (Saturday)
|
$dayOfYear |
first day of year included in the week #1
|
|
#
|
public
static
|
withTestNow(DateTimeInterface|Closure|static|string|false|null $testNow = null, Closure|null $callback = null): mixed
Temporarily sets a static date to be used within the callback.
Using setTestNow to set the date, executing the callback…
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
$testNow |
real or mock Carbon instance
|
|
#
|
public
static
|
yesterday(DateTimeZone|string|null $tz = null): static
Create a Carbon instance for yesterday.
Create a Carbon instance for yesterday.
|
#
|
public
|
isUtc(): bool
Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
Implemented by
|
#
|
public
|
isLocal(): bool
Check if the current instance has non-UTC timezone.
Check if the current instance has non-UTC timezone.
Implemented by
|
#
|
public
|
isValid(): bool
Check if the current instance is a valid date.
Check if the current instance is a valid date.
Implemented by
|
#
|
public
|
isDST(): bool
Check if the current instance is in a daylight saving time.
Check if the current instance is in a daylight saving time.
Implemented by
|
#
|
public
|
isSunday(): bool
Checks if the instance day is sunday.
Checks if the instance day is sunday.
Implemented by
|
#
|
public
|
isMonday(): bool
Checks if the instance day is monday.
Checks if the instance day is monday.
Implemented by
|
#
|
public
|
isTuesday(): bool
Checks if the instance day is tuesday.
Checks if the instance day is tuesday.
Implemented by
|
#
|
public
|
isWednesday(): bool
Checks if the instance day is wednesday.
Checks if the instance day is wednesday.
Implemented by
|
#
|
public
|
isThursday(): bool
Checks if the instance day is thursday.
Checks if the instance day is thursday.
Implemented by
|
#
|
public
|
isFriday(): bool
Checks if the instance day is friday.
Checks if the instance day is friday.
Implemented by
|
#
|
public
|
isSaturday(): bool
Checks if the instance day is saturday.
Checks if the instance day is saturday.
Implemented by
|
#
|
public
|
isSameYear(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentYear(): bool
Checks if the instance is in the same year as the current moment.
Checks if the instance is in the same year as the current moment.
Implemented by
|
#
|
public
|
isNextYear(): bool
Checks if the instance is in the same year as the current moment next year.
Checks if the instance is in the same year as the current moment next year.
Implemented by
|
#
|
public
|
isLastYear(): bool
Checks if the instance is in the same year as the current moment last year.
Checks if the instance is in the same year as the current moment last year.
Implemented by
|
#
|
public
|
isSameWeek(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentWeek(): bool
Checks if the instance is in the same week as the current moment.
Checks if the instance is in the same week as the current moment.
Implemented by
|
#
|
public
|
isNextWeek(): bool
Checks if the instance is in the same week as the current moment next week.
Checks if the instance is in the same week as the current moment next week.
Implemented by
|
#
|
public
|
isLastWeek(): bool
Checks if the instance is in the same week as the current moment last week.
Checks if the instance is in the same week as the current moment last week.
Implemented by
|
#
|
public
|
isSameDay(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentDay(): bool
Checks if the instance is in the same day as the current moment.
Checks if the instance is in the same day as the current moment.
Implemented by
|
#
|
public
|
isNextDay(): bool
Checks if the instance is in the same day as the current moment next day.
Checks if the instance is in the same day as the current moment next day.
Implemented by
|
#
|
public
|
isLastDay(): bool
Checks if the instance is in the same day as the current moment last day.
Checks if the instance is in the same day as the current moment last day.
Implemented by
|
#
|
public
|
isSameHour(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentHour(): bool
Checks if the instance is in the same hour as the current moment.
Checks if the instance is in the same hour as the current moment.
Implemented by
|
#
|
public
|
isNextHour(): bool
Checks if the instance is in the same hour as the current moment next hour.
Checks if the instance is in the same hour as the current moment next hour.
Implemented by
|
#
|
public
|
isLastHour(): bool
Checks if the instance is in the same hour as the current moment last hour.
Checks if the instance is in the same hour as the current moment last hour.
Implemented by
|
#
|
public
|
isSameMinute(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentMinute(): bool
Checks if the instance is in the same minute as the current moment.
Checks if the instance is in the same minute as the current moment.
Implemented by
|
#
|
public
|
isNextMinute(): bool
Checks if the instance is in the same minute as the current moment next minute.
Checks if the instance is in the same minute as the current moment next minute.
Implemented by
|
#
|
public
|
isLastMinute(): bool
Checks if the instance is in the same minute as the current moment last minute.
Checks if the instance is in the same minute as the current moment last minute.
Implemented by
|
#
|
public
|
isSameSecond(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentSecond(): bool
Checks if the instance is in the same second as the current moment.
Checks if the instance is in the same second as the current moment.
Implemented by
|
#
|
public
|
isNextSecond(): bool
Checks if the instance is in the same second as the current moment next second.
Checks if the instance is in the same second as the current moment next second.
Implemented by
|
#
|
public
|
isLastSecond(): bool
Checks if the instance is in the same second as the current moment last second.
Checks if the instance is in the same second as the current moment last second.
Implemented by
|
#
|
public
|
isSameMicro(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same…
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentMicro(): bool
Checks if the instance is in the same microsecond as the current moment.
Checks if the instance is in the same microsecond as the current moment.
Implemented by
|
#
|
public
|
isNextMicro(): bool
Checks if the instance is in the same microsecond as the current moment next microsecond.
Checks if the instance is in the same microsecond as the current moment next microsecond.
Implemented by
|
#
|
public
|
isLastMicro(): bool
Checks if the instance is in the same microsecond as the current moment last microsecond.
Checks if the instance is in the same microsecond as the current moment last microsecond.
Implemented by
|
#
|
public
|
isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same…
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentMicrosecond(): bool
Checks if the instance is in the same microsecond as the current moment.
Checks if the instance is in the same microsecond as the current moment.
Implemented by
|
#
|
public
|
isNextMicrosecond(): bool
Checks if the instance is in the same microsecond as the current moment next microsecond.
Checks if the instance is in the same microsecond as the current moment next microsecond.
Implemented by
|
#
|
public
|
isLastMicrosecond(): bool
Checks if the instance is in the same microsecond as the current moment last microsecond.
Checks if the instance is in the same microsecond as the current moment last microsecond.
Implemented by
|
#
|
public
|
isCurrentMonth(): bool
Checks if the instance is in the same month as the current moment.
Checks if the instance is in the same month as the current moment.
Implemented by
|
#
|
public
|
isNextMonth(): bool
Checks if the instance is in the same month as the current moment next month.
Checks if the instance is in the same month as the current moment next month.
Implemented by
|
#
|
public
|
isLastMonth(): bool
Checks if the instance is in the same month as the current moment last month.
Checks if the instance is in the same month as the current moment last month.
Implemented by
|
#
|
public
|
isCurrentQuarter(): bool
Checks if the instance is in the same quarter as the current moment.
Checks if the instance is in the same quarter as the current moment.
Implemented by
|
#
|
public
|
isNextQuarter(): bool
Checks if the instance is in the same quarter as the current moment next quarter.
Checks if the instance is in the same quarter as the current moment next quarter.
Implemented by
|
#
|
public
|
isLastQuarter(): bool
Checks if the instance is in the same quarter as the current moment last quarter.
Checks if the instance is in the same quarter as the current moment last quarter.
Implemented by
|
#
|
public
|
isSameDecade(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentDecade(): bool
Checks if the instance is in the same decade as the current moment.
Checks if the instance is in the same decade as the current moment.
Implemented by
|
#
|
public
|
isNextDecade(): bool
Checks if the instance is in the same decade as the current moment next decade.
Checks if the instance is in the same decade as the current moment next decade.
Implemented by
|
#
|
public
|
isLastDecade(): bool
Checks if the instance is in the same decade as the current moment last decade.
Checks if the instance is in the same decade as the current moment last decade.
Implemented by
|
#
|
public
|
isSameCentury(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone…
Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentCentury(): bool
Checks if the instance is in the same century as the current moment.
Checks if the instance is in the same century as the current moment.
Implemented by
|
#
|
public
|
isNextCentury(): bool
Checks if the instance is in the same century as the current moment next century.
Checks if the instance is in the same century as the current moment next century.
Implemented by
|
#
|
public
|
isLastCentury(): bool
Checks if the instance is in the same century as the current moment last century.
Checks if the instance is in the same century as the current moment last century.
Implemented by
|
#
|
public
|
isSameMillennium(Carbon|DateTimeInterface|string|null $date = null): bool
Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same…
Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
Implemented by
|
#
|
public
|
isCurrentMillennium(): bool
Checks if the instance is in the same millennium as the current moment.
Checks if the instance is in the same millennium as the current moment.
Implemented by
|
#
|
public
|
isNextMillennium(): bool
Checks if the instance is in the same millennium as the current moment next millennium.
Checks if the instance is in the same millennium as the current moment next millennium.
Implemented by
|
#
|
public
|
isLastMillennium(): bool
Checks if the instance is in the same millennium as the current moment last millennium.
Checks if the instance is in the same millennium as the current moment last millennium.
Implemented by
|
#
|
public
|
years(int $value): CarbonInterface
Set current instance year to the given value.
Set current instance year to the given value.
Implemented by
|
#
|
public
|
year(int $value): CarbonInterface
Set current instance year to the given value.
Set current instance year to the given value.
Implemented by
|
#
|
public
|
setYears(int $value): CarbonInterface
Set current instance year to the given value.
Set current instance year to the given value.
Implemented by
|
#
|
public
|
setYear(int $value): CarbonInterface
Set current instance year to the given value.
Set current instance year to the given value.
Implemented by
|
#
|
public
|
months(int $value): CarbonInterface
Set current instance month to the given value.
Set current instance month to the given value.
Implemented by
|
#
|
public
|
month(int $value): CarbonInterface
Set current instance month to the given value.
Set current instance month to the given value.
Implemented by
|
#
|
public
|
setMonths(int $value): CarbonInterface
Set current instance month to the given value.
Set current instance month to the given value.
Implemented by
|
#
|
public
|
setMonth(int $value): CarbonInterface
Set current instance month to the given value.
Set current instance month to the given value.
Implemented by
|
#
|
public
|
days(int $value): CarbonInterface
Set current instance day to the given value.
Set current instance day to the given value.
Implemented by
|
#
|
public
|
day(int $value): CarbonInterface
Set current instance day to the given value.
Set current instance day to the given value.
Implemented by
|
#
|
public
|
setDays(int $value): CarbonInterface
Set current instance day to the given value.
Set current instance day to the given value.
Implemented by
|
#
|
public
|
setDay(int $value): CarbonInterface
Set current instance day to the given value.
Set current instance day to the given value.
Implemented by
|
#
|
public
|
hours(int $value): CarbonInterface
Set current instance hour to the given value.
Set current instance hour to the given value.
Implemented by
|
#
|
public
|
hour(int $value): CarbonInterface
Set current instance hour to the given value.
Set current instance hour to the given value.
Implemented by
|
#
|
public
|
setHours(int $value): CarbonInterface
Set current instance hour to the given value.
Set current instance hour to the given value.
Implemented by
|
#
|
public
|
setHour(int $value): CarbonInterface
Set current instance hour to the given value.
Set current instance hour to the given value.
Implemented by
|
#
|
public
|
minutes(int $value): CarbonInterface
Set current instance minute to the given value.
Set current instance minute to the given value.
Implemented by
|
#
|
public
|
minute(int $value): CarbonInterface
Set current instance minute to the given value.
Set current instance minute to the given value.
Implemented by
|
#
|
public
|
setMinutes(int $value): CarbonInterface
Set current instance minute to the given value.
Set current instance minute to the given value.
Implemented by
|
#
|
public
|
setMinute(int $value): CarbonInterface
Set current instance minute to the given value.
Set current instance minute to the given value.
Implemented by
|
#
|
public
|
seconds(int $value): CarbonInterface
Set current instance second to the given value.
Set current instance second to the given value.
Implemented by
|
#
|
public
|
second(int $value): CarbonInterface
Set current instance second to the given value.
Set current instance second to the given value.
Implemented by
|
#
|
public
|
setSeconds(int $value): CarbonInterface
Set current instance second to the given value.
Set current instance second to the given value.
Implemented by
|
#
|
public
|
setSecond(int $value): CarbonInterface
Set current instance second to the given value.
Set current instance second to the given value.
Implemented by
|
#
|
public
|
millis(int $value): CarbonInterface
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Implemented by
|
#
|
public
|
milli(int $value): CarbonInterface
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Implemented by
|
#
|
public
|
setMillis(int $value): CarbonInterface
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Implemented by
|
#
|
public
|
setMilli(int $value): CarbonInterface
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Implemented by
|
#
|
public
|
milliseconds(int $value): CarbonInterface
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Implemented by
|
#
|
public
|
millisecond(int $value): CarbonInterface
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Implemented by
|
#
|
public
|
setMilliseconds(int $value): CarbonInterface
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Implemented by
|
#
|
public
|
setMillisecond(int $value): CarbonInterface
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Implemented by
|
#
|
public
|
micros(int $value): CarbonInterface
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Implemented by
|
#
|
public
|
micro(int $value): CarbonInterface
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Implemented by
|
#
|
public
|
setMicros(int $value): CarbonInterface
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Implemented by
|
#
|
public
|
setMicro(int $value): CarbonInterface
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Implemented by
|
#
|
public
|
microseconds(int $value): CarbonInterface
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Implemented by
|
#
|
public
|
microsecond(int $value): CarbonInterface
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Implemented by
|
#
|
public
|
setMicroseconds(int $value): CarbonInterface
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Implemented by
|
#
|
public
|
setMicrosecond(int $value): CarbonInterface
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Implemented by
|
#
|
public
|
addYears(int $value = 1): CarbonInterface
Add years (the $value count passed in) to the instance (using date interval).
Add years (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addYear(): CarbonInterface
Add one year to the instance (using date interval).
Add one year to the instance (using date interval).
Implemented by
|
#
|
public
|
subYears(int $value = 1): CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval).
Sub years (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subYear(): CarbonInterface
Sub one year to the instance (using date interval).
Sub one year to the instance (using date interval).
Implemented by
|
#
|
public
|
addYearsWithOverflow(int $value = 1): CarbonInterface
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addYearWithOverflow(): CarbonInterface
Add one year to the instance (using date interval) with overflow explicitly allowed.
Add one year to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subYearsWithOverflow(int $value = 1): CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subYearWithOverflow(): CarbonInterface
Sub one year to the instance (using date interval) with overflow explicitly allowed.
Sub one year to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addYearsWithoutOverflow(int $value = 1): CarbonInterface
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addYearWithoutOverflow(): CarbonInterface
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subYearsWithoutOverflow(int $value = 1): CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subYearWithoutOverflow(): CarbonInterface
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addYearsWithNoOverflow(int $value = 1): CarbonInterface
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addYearWithNoOverflow(): CarbonInterface
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subYearsWithNoOverflow(int $value = 1): CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subYearWithNoOverflow(): CarbonInterface
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addYearsNoOverflow(int $value = 1): CarbonInterface
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addYearNoOverflow(): CarbonInterface
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Add one year to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subYearsNoOverflow(int $value = 1): CarbonInterface
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subYearNoOverflow(): CarbonInterface
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMonths(int $value = 1): CarbonInterface
Add months (the $value count passed in) to the instance (using date interval).
Add months (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addMonth(): CarbonInterface
Add one month to the instance (using date interval).
Add one month to the instance (using date interval).
Implemented by
|
#
|
public
|
subMonths(int $value = 1): CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval).
Sub months (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subMonth(): CarbonInterface
Sub one month to the instance (using date interval).
Sub one month to the instance (using date interval).
Implemented by
|
#
|
public
|
addMonthsWithOverflow(int $value = 1): CarbonInterface
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addMonthWithOverflow(): CarbonInterface
Add one month to the instance (using date interval) with overflow explicitly allowed.
Add one month to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subMonthsWithOverflow(int $value = 1): CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subMonthWithOverflow(): CarbonInterface
Sub one month to the instance (using date interval) with overflow explicitly allowed.
Sub one month to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addMonthsWithoutOverflow(int $value = 1): CarbonInterface
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMonthWithoutOverflow(): CarbonInterface
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMonthsWithoutOverflow(int $value = 1): CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMonthWithoutOverflow(): CarbonInterface
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMonthsWithNoOverflow(int $value = 1): CarbonInterface
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMonthWithNoOverflow(): CarbonInterface
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMonthsWithNoOverflow(int $value = 1): CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMonthWithNoOverflow(): CarbonInterface
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMonthsNoOverflow(int $value = 1): CarbonInterface
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMonthNoOverflow(): CarbonInterface
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Add one month to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMonthsNoOverflow(int $value = 1): CarbonInterface
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMonthNoOverflow(): CarbonInterface
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addDays(int $value = 1): CarbonInterface
Add days (the $value count passed in) to the instance (using date interval).
Add days (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addDay(): CarbonInterface
Add one day to the instance (using date interval).
Add one day to the instance (using date interval).
Implemented by
|
#
|
public
|
subDays(int $value = 1): CarbonInterface
Sub days (the $value count passed in) to the instance (using date interval).
Sub days (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subDay(): CarbonInterface
Sub one day to the instance (using date interval).
Sub one day to the instance (using date interval).
Implemented by
|
#
|
public
|
addHours(int $value = 1): CarbonInterface
Add hours (the $value count passed in) to the instance (using date interval).
Add hours (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addHour(): CarbonInterface
Add one hour to the instance (using date interval).
Add one hour to the instance (using date interval).
Implemented by
|
#
|
public
|
subHours(int $value = 1): CarbonInterface
Sub hours (the $value count passed in) to the instance (using date interval).
Sub hours (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subHour(): CarbonInterface
Sub one hour to the instance (using date interval).
Sub one hour to the instance (using date interval).
Implemented by
|
#
|
public
|
addMinutes(int $value = 1): CarbonInterface
Add minutes (the $value count passed in) to the instance (using date interval).
Add minutes (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addMinute(): CarbonInterface
Add one minute to the instance (using date interval).
Add one minute to the instance (using date interval).
Implemented by
|
#
|
public
|
subMinutes(int $value = 1): CarbonInterface
Sub minutes (the $value count passed in) to the instance (using date interval).
Sub minutes (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subMinute(): CarbonInterface
Sub one minute to the instance (using date interval).
Sub one minute to the instance (using date interval).
Implemented by
|
#
|
public
|
addSeconds(int $value = 1): CarbonInterface
Add seconds (the $value count passed in) to the instance (using date interval).
Add seconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addSecond(): CarbonInterface
Add one second to the instance (using date interval).
Add one second to the instance (using date interval).
Implemented by
|
#
|
public
|
subSeconds(int $value = 1): CarbonInterface
Sub seconds (the $value count passed in) to the instance (using date interval).
Sub seconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subSecond(): CarbonInterface
Sub one second to the instance (using date interval).
Sub one second to the instance (using date interval).
Implemented by
|
#
|
public
|
addMillis(int $value = 1): CarbonInterface
Add milliseconds (the $value count passed in) to the instance (using date interval).
Add milliseconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addMilli(): CarbonInterface
Add one millisecond to the instance (using date interval).
Add one millisecond to the instance (using date interval).
Implemented by
|
#
|
public
|
subMillis(int $value = 1): CarbonInterface
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subMilli(): CarbonInterface
Sub one millisecond to the instance (using date interval).
Sub one millisecond to the instance (using date interval).
Implemented by
|
#
|
public
|
addMilliseconds(int $value = 1): CarbonInterface
Add milliseconds (the $value count passed in) to the instance (using date interval).
Add milliseconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addMillisecond(): CarbonInterface
Add one millisecond to the instance (using date interval).
Add one millisecond to the instance (using date interval).
Implemented by
|
#
|
public
|
subMilliseconds(int $value = 1): CarbonInterface
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subMillisecond(): CarbonInterface
Sub one millisecond to the instance (using date interval).
Sub one millisecond to the instance (using date interval).
Implemented by
|
#
|
public
|
addMicros(int $value = 1): CarbonInterface
Add microseconds (the $value count passed in) to the instance (using date interval).
Add microseconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addMicro(): CarbonInterface
Add one microsecond to the instance (using date interval).
Add one microsecond to the instance (using date interval).
Implemented by
|
#
|
public
|
subMicros(int $value = 1): CarbonInterface
Sub microseconds (the $value count passed in) to the instance (using date interval).
Sub microseconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subMicro(): CarbonInterface
Sub one microsecond to the instance (using date interval).
Sub one microsecond to the instance (using date interval).
Implemented by
|
#
|
public
|
addMicroseconds(int $value = 1): CarbonInterface
Add microseconds (the $value count passed in) to the instance (using date interval).
Add microseconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addMicrosecond(): CarbonInterface
Add one microsecond to the instance (using date interval).
Add one microsecond to the instance (using date interval).
Implemented by
|
#
|
public
|
subMicroseconds(int $value = 1): CarbonInterface
Sub microseconds (the $value count passed in) to the instance (using date interval).
Sub microseconds (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subMicrosecond(): CarbonInterface
Sub one microsecond to the instance (using date interval).
Sub one microsecond to the instance (using date interval).
Implemented by
|
#
|
public
|
addMillennia(int $value = 1): CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval).
Add millennia (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addMillennium(): CarbonInterface
Add one millennium to the instance (using date interval).
Add one millennium to the instance (using date interval).
Implemented by
|
#
|
public
|
subMillennia(int $value = 1): CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval).
Sub millennia (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subMillennium(): CarbonInterface
Sub one millennium to the instance (using date interval).
Sub one millennium to the instance (using date interval).
Implemented by
|
#
|
public
|
addMillenniaWithOverflow(int $value = 1): CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addMillenniumWithOverflow(): CarbonInterface
Add one millennium to the instance (using date interval) with overflow explicitly allowed.
Add one millennium to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subMillenniaWithOverflow(int $value = 1): CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subMillenniumWithOverflow(): CarbonInterface
Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addMillenniaWithoutOverflow(int $value = 1): CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMillenniumWithoutOverflow(): CarbonInterface
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMillenniaWithoutOverflow(int $value = 1): CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMillenniumWithoutOverflow(): CarbonInterface
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMillenniaWithNoOverflow(int $value = 1): CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMillenniumWithNoOverflow(): CarbonInterface
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMillenniaWithNoOverflow(int $value = 1): CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMillenniumWithNoOverflow(): CarbonInterface
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMillenniaNoOverflow(int $value = 1): CarbonInterface
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addMillenniumNoOverflow(): CarbonInterface
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMillenniaNoOverflow(int $value = 1): CarbonInterface
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subMillenniumNoOverflow(): CarbonInterface
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addCenturies(int $value = 1): CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval).
Add centuries (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addCentury(): CarbonInterface
Add one century to the instance (using date interval).
Add one century to the instance (using date interval).
Implemented by
|
#
|
public
|
subCenturies(int $value = 1): CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval).
Sub centuries (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subCentury(): CarbonInterface
Sub one century to the instance (using date interval).
Sub one century to the instance (using date interval).
Implemented by
|
#
|
public
|
addCenturiesWithOverflow(int $value = 1): CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addCenturyWithOverflow(): CarbonInterface
Add one century to the instance (using date interval) with overflow explicitly allowed.
Add one century to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subCenturiesWithOverflow(int $value = 1): CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subCenturyWithOverflow(): CarbonInterface
Sub one century to the instance (using date interval) with overflow explicitly allowed.
Sub one century to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addCenturiesWithoutOverflow(int $value = 1): CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addCenturyWithoutOverflow(): CarbonInterface
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subCenturiesWithoutOverflow(int $value = 1): CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subCenturyWithoutOverflow(): CarbonInterface
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addCenturiesWithNoOverflow(int $value = 1): CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addCenturyWithNoOverflow(): CarbonInterface
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subCenturiesWithNoOverflow(int $value = 1): CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subCenturyWithNoOverflow(): CarbonInterface
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addCenturiesNoOverflow(int $value = 1): CarbonInterface
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addCenturyNoOverflow(): CarbonInterface
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Add one century to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subCenturiesNoOverflow(int $value = 1): CarbonInterface
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subCenturyNoOverflow(): CarbonInterface
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addDecades(int $value = 1): CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval).
Add decades (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addDecade(): CarbonInterface
Add one decade to the instance (using date interval).
Add one decade to the instance (using date interval).
Implemented by
|
#
|
public
|
subDecades(int $value = 1): CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval).
Sub decades (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subDecade(): CarbonInterface
Sub one decade to the instance (using date interval).
Sub one decade to the instance (using date interval).
Implemented by
|
#
|
public
|
addDecadesWithOverflow(int $value = 1): CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addDecadeWithOverflow(): CarbonInterface
Add one decade to the instance (using date interval) with overflow explicitly allowed.
Add one decade to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subDecadesWithOverflow(int $value = 1): CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subDecadeWithOverflow(): CarbonInterface
Sub one decade to the instance (using date interval) with overflow explicitly allowed.
Sub one decade to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addDecadesWithoutOverflow(int $value = 1): CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addDecadeWithoutOverflow(): CarbonInterface
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subDecadesWithoutOverflow(int $value = 1): CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subDecadeWithoutOverflow(): CarbonInterface
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addDecadesWithNoOverflow(int $value = 1): CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addDecadeWithNoOverflow(): CarbonInterface
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subDecadesWithNoOverflow(int $value = 1): CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subDecadeWithNoOverflow(): CarbonInterface
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addDecadesNoOverflow(int $value = 1): CarbonInterface
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addDecadeNoOverflow(): CarbonInterface
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subDecadesNoOverflow(int $value = 1): CarbonInterface
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subDecadeNoOverflow(): CarbonInterface
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addQuarters(int $value = 1): CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval).
Add quarters (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addQuarter(): CarbonInterface
Add one quarter to the instance (using date interval).
Add one quarter to the instance (using date interval).
Implemented by
|
#
|
public
|
subQuarters(int $value = 1): CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval).
Sub quarters (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subQuarter(): CarbonInterface
Sub one quarter to the instance (using date interval).
Sub one quarter to the instance (using date interval).
Implemented by
|
#
|
public
|
addQuartersWithOverflow(int $value = 1): CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addQuarterWithOverflow(): CarbonInterface
Add one quarter to the instance (using date interval) with overflow explicitly allowed.
Add one quarter to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subQuartersWithOverflow(int $value = 1): CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
subQuarterWithOverflow(): CarbonInterface
Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
Implemented by
|
#
|
public
|
addQuartersWithoutOverflow(int $value = 1): CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addQuarterWithoutOverflow(): CarbonInterface
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subQuartersWithoutOverflow(int $value = 1): CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subQuarterWithoutOverflow(): CarbonInterface
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addQuartersWithNoOverflow(int $value = 1): CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addQuarterWithNoOverflow(): CarbonInterface
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subQuartersWithNoOverflow(int $value = 1): CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subQuarterWithNoOverflow(): CarbonInterface
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addQuartersNoOverflow(int $value = 1): CarbonInterface
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addQuarterNoOverflow(): CarbonInterface
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subQuartersNoOverflow(int $value = 1): CarbonInterface
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
subQuarterNoOverflow(): CarbonInterface
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Implemented by
|
#
|
public
|
addWeeks(int $value = 1): CarbonInterface
Add weeks (the $value count passed in) to the instance (using date interval).
Add weeks (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addWeek(): CarbonInterface
Add one week to the instance (using date interval).
Add one week to the instance (using date interval).
Implemented by
|
#
|
public
|
subWeeks(int $value = 1): CarbonInterface
Sub weeks (the $value count passed in) to the instance (using date interval).
Sub weeks (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subWeek(): CarbonInterface
Sub one week to the instance (using date interval).
Sub one week to the instance (using date interval).
Implemented by
|
#
|
public
|
addWeekdays(int $value = 1): CarbonInterface
Add weekdays (the $value count passed in) to the instance (using date interval).
Add weekdays (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
addWeekday(): CarbonInterface
Add one weekday to the instance (using date interval).
Add one weekday to the instance (using date interval).
Implemented by
|
#
|
public
|
subWeekdays(int $value = 1): CarbonInterface
Sub weekdays (the $value count passed in) to the instance (using date interval).
Sub weekdays (the $value count passed in) to the instance (using date interval).
Implemented by
|
#
|
public
|
subWeekday(): CarbonInterface
Sub one weekday to the instance (using date interval).
Sub one weekday to the instance (using date interval).
Implemented by
|
#
|
public
|
addRealMicros(int $value = 1): CarbonInterface
Add microseconds (the $value count passed in) to the instance (using timestamp).
Add microseconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealMicro(): CarbonInterface
Add one microsecond to the instance (using timestamp).
Add one microsecond to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMicros(int $value = 1): CarbonInterface
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMicro(): CarbonInterface
Sub one microsecond to the instance (using timestamp).
Sub one microsecond to the instance (using timestamp).
Implemented by
|
#
|
public
|
microsUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or…
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.
Implemented by
|
#
|
public
|
addRealMicroseconds(int $value = 1): CarbonInterface
Add microseconds (the $value count passed in) to the instance (using timestamp).
Add microseconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealMicrosecond(): CarbonInterface
Add one microsecond to the instance (using timestamp).
Add one microsecond to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMicroseconds(int $value = 1): CarbonInterface
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMicrosecond(): CarbonInterface
Sub one microsecond to the instance (using timestamp).
Sub one microsecond to the instance (using timestamp).
Implemented by
|
#
|
public
|
microsecondsUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or…
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.
Implemented by
|
#
|
public
|
addRealMillis(int $value = 1): CarbonInterface
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealMilli(): CarbonInterface
Add one millisecond to the instance (using timestamp).
Add one millisecond to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMillis(int $value = 1): CarbonInterface
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMilli(): CarbonInterface
Sub one millisecond to the instance (using timestamp).
Sub one millisecond to the instance (using timestamp).
Implemented by
|
#
|
public
|
millisUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or…
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.
Implemented by
|
#
|
public
|
addRealMilliseconds(int $value = 1): CarbonInterface
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealMillisecond(): CarbonInterface
Add one millisecond to the instance (using timestamp).
Add one millisecond to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMilliseconds(int $value = 1): CarbonInterface
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMillisecond(): CarbonInterface
Sub one millisecond to the instance (using timestamp).
Sub one millisecond to the instance (using timestamp).
Implemented by
|
#
|
public
|
millisecondsUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or…
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.
Implemented by
|
#
|
public
|
addRealSeconds(int $value = 1): CarbonInterface
Add seconds (the $value count passed in) to the instance (using timestamp).
Add seconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealSecond(): CarbonInterface
Add one second to the instance (using timestamp).
Add one second to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealSeconds(int $value = 1): CarbonInterface
Sub seconds (the $value count passed in) to the instance (using timestamp).
Sub seconds (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealSecond(): CarbonInterface
Sub one second to the instance (using timestamp).
Sub one second to the instance (using timestamp).
Implemented by
|
#
|
public
|
secondsUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every…
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.
Implemented by
|
#
|
public
|
addRealMinutes(int $value = 1): CarbonInterface
Add minutes (the $value count passed in) to the instance (using timestamp).
Add minutes (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealMinute(): CarbonInterface
Add one minute to the instance (using timestamp).
Add one minute to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMinutes(int $value = 1): CarbonInterface
Sub minutes (the $value count passed in) to the instance (using timestamp).
Sub minutes (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMinute(): CarbonInterface
Sub one minute to the instance (using timestamp).
Sub one minute to the instance (using timestamp).
Implemented by
|
#
|
public
|
minutesUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every…
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.
Implemented by
|
#
|
public
|
addRealHours(int $value = 1): CarbonInterface
Add hours (the $value count passed in) to the instance (using timestamp).
Add hours (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealHour(): CarbonInterface
Add one hour to the instance (using timestamp).
Add one hour to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealHours(int $value = 1): CarbonInterface
Sub hours (the $value count passed in) to the instance (using timestamp).
Sub hours (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealHour(): CarbonInterface
Sub one hour to the instance (using timestamp).
Sub one hour to the instance (using timestamp).
Implemented by
|
#
|
public
|
hoursUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X…
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.
Implemented by
|
#
|
public
|
addRealDays(int $value = 1): CarbonInterface
Add days (the $value count passed in) to the instance (using timestamp).
Add days (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealDay(): CarbonInterface
Add one day to the instance (using timestamp).
Add one day to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealDays(int $value = 1): CarbonInterface
Sub days (the $value count passed in) to the instance (using timestamp).
Sub days (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealDay(): CarbonInterface
Sub one day to the instance (using timestamp).
Sub one day to the instance (using timestamp).
Implemented by
|
#
|
public
|
daysUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X…
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.
Implemented by
|
#
|
public
|
addRealWeeks(int $value = 1): CarbonInterface
Add weeks (the $value count passed in) to the instance (using timestamp).
Add weeks (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealWeek(): CarbonInterface
Add one week to the instance (using timestamp).
Add one week to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealWeeks(int $value = 1): CarbonInterface
Sub weeks (the $value count passed in) to the instance (using timestamp).
Sub weeks (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealWeek(): CarbonInterface
Sub one week to the instance (using timestamp).
Sub one week to the instance (using timestamp).
Implemented by
|
#
|
public
|
weeksUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X…
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.
Implemented by
|
#
|
public
|
addRealMonths(int $value = 1): CarbonInterface
Add months (the $value count passed in) to the instance (using timestamp).
Add months (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealMonth(): CarbonInterface
Add one month to the instance (using timestamp).
Add one month to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMonths(int $value = 1): CarbonInterface
Sub months (the $value count passed in) to the instance (using timestamp).
Sub months (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMonth(): CarbonInterface
Sub one month to the instance (using timestamp).
Sub one month to the instance (using timestamp).
Implemented by
|
#
|
public
|
monthsUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every…
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.
Implemented by
|
#
|
public
|
addRealQuarters(int $value = 1): CarbonInterface
Add quarters (the $value count passed in) to the instance (using timestamp).
Add quarters (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealQuarter(): CarbonInterface
Add one quarter to the instance (using timestamp).
Add one quarter to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealQuarters(int $value = 1): CarbonInterface
Sub quarters (the $value count passed in) to the instance (using timestamp).
Sub quarters (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealQuarter(): CarbonInterface
Sub one quarter to the instance (using timestamp).
Sub one quarter to the instance (using timestamp).
Implemented by
|
#
|
public
|
quartersUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or…
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.
Implemented by
|
#
|
public
|
addRealYears(int $value = 1): CarbonInterface
Add years (the $value count passed in) to the instance (using timestamp).
Add years (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealYear(): CarbonInterface
Add one year to the instance (using timestamp).
Add one year to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealYears(int $value = 1): CarbonInterface
Sub years (the $value count passed in) to the instance (using timestamp).
Sub years (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealYear(): CarbonInterface
Sub one year to the instance (using timestamp).
Sub one year to the instance (using timestamp).
Implemented by
|
#
|
public
|
yearsUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X…
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.
Implemented by
|
#
|
public
|
addRealDecades(int $value = 1): CarbonInterface
Add decades (the $value count passed in) to the instance (using timestamp).
Add decades (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealDecade(): CarbonInterface
Add one decade to the instance (using timestamp).
Add one decade to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealDecades(int $value = 1): CarbonInterface
Sub decades (the $value count passed in) to the instance (using timestamp).
Sub decades (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealDecade(): CarbonInterface
Sub one decade to the instance (using timestamp).
Sub one decade to the instance (using timestamp).
Implemented by
|
#
|
public
|
decadesUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every…
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.
Implemented by
|
#
|
public
|
addRealCenturies(int $value = 1): CarbonInterface
Add centuries (the $value count passed in) to the instance (using timestamp).
Add centuries (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealCentury(): CarbonInterface
Add one century to the instance (using timestamp).
Add one century to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealCenturies(int $value = 1): CarbonInterface
Sub centuries (the $value count passed in) to the instance (using timestamp).
Sub centuries (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealCentury(): CarbonInterface
Sub one century to the instance (using timestamp).
Sub one century to the instance (using timestamp).
Implemented by
|
#
|
public
|
centuriesUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or…
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.
Implemented by
|
#
|
public
|
addRealMillennia(int $value = 1): CarbonInterface
Add millennia (the $value count passed in) to the instance (using timestamp).
Add millennia (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
addRealMillennium(): CarbonInterface
Add one millennium to the instance (using timestamp).
Add one millennium to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMillennia(int $value = 1): CarbonInterface
Sub millennia (the $value count passed in) to the instance (using timestamp).
Sub millennia (the $value count passed in) to the instance (using timestamp).
Implemented by
|
#
|
public
|
subRealMillennium(): CarbonInterface
Sub one millennium to the instance (using timestamp).
Sub one millennium to the instance (using timestamp).
Implemented by
|
#
|
public
|
millenniaUntil($endDate = null, int $factor = 1): CarbonPeriod
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or…
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.
Implemented by
|
#
|
public
|
roundYear(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance year with given precision using the given function.
Round the current instance year with given precision using the given function.
Implemented by
|
#
|
public
|
roundYears(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance year with given precision using the given function.
Round the current instance year with given precision using the given function.
Implemented by
|
#
|
public
|
floorYear(float $precision = 1): CarbonInterface
Truncate the current instance year with given precision.
Truncate the current instance year with given precision.
Implemented by
|
#
|
public
|
floorYears(float $precision = 1): CarbonInterface
Truncate the current instance year with given precision.
Truncate the current instance year with given precision.
Implemented by
|
#
|
public
|
ceilYear(float $precision = 1): CarbonInterface
Ceil the current instance year with given precision.
Ceil the current instance year with given precision.
Implemented by
|
#
|
public
|
ceilYears(float $precision = 1): CarbonInterface
Ceil the current instance year with given precision.
Ceil the current instance year with given precision.
Implemented by
|
#
|
public
|
roundMonth(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance month with given precision using the given function.
Round the current instance month with given precision using the given function.
Implemented by
|
#
|
public
|
roundMonths(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance month with given precision using the given function.
Round the current instance month with given precision using the given function.
Implemented by
|
#
|
public
|
floorMonth(float $precision = 1): CarbonInterface
Truncate the current instance month with given precision.
Truncate the current instance month with given precision.
Implemented by
|
#
|
public
|
floorMonths(float $precision = 1): CarbonInterface
Truncate the current instance month with given precision.
Truncate the current instance month with given precision.
Implemented by
|
#
|
public
|
ceilMonth(float $precision = 1): CarbonInterface
Ceil the current instance month with given precision.
Ceil the current instance month with given precision.
Implemented by
|
#
|
public
|
ceilMonths(float $precision = 1): CarbonInterface
Ceil the current instance month with given precision.
Ceil the current instance month with given precision.
Implemented by
|
#
|
public
|
roundDay(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance day with given precision using the given function.
Round the current instance day with given precision using the given function.
Implemented by
|
#
|
public
|
roundDays(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance day with given precision using the given function.
Round the current instance day with given precision using the given function.
Implemented by
|
#
|
public
|
floorDay(float $precision = 1): CarbonInterface
Truncate the current instance day with given precision.
Truncate the current instance day with given precision.
Implemented by
|
#
|
public
|
floorDays(float $precision = 1): CarbonInterface
Truncate the current instance day with given precision.
Truncate the current instance day with given precision.
Implemented by
|
#
|
public
|
ceilDay(float $precision = 1): CarbonInterface
Ceil the current instance day with given precision.
Ceil the current instance day with given precision.
Implemented by
|
#
|
public
|
ceilDays(float $precision = 1): CarbonInterface
Ceil the current instance day with given precision.
Ceil the current instance day with given precision.
Implemented by
|
#
|
public
|
roundHour(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance hour with given precision using the given function.
Round the current instance hour with given precision using the given function.
Implemented by
|
#
|
public
|
roundHours(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance hour with given precision using the given function.
Round the current instance hour with given precision using the given function.
Implemented by
|
#
|
public
|
floorHour(float $precision = 1): CarbonInterface
Truncate the current instance hour with given precision.
Truncate the current instance hour with given precision.
Implemented by
|
#
|
public
|
floorHours(float $precision = 1): CarbonInterface
Truncate the current instance hour with given precision.
Truncate the current instance hour with given precision.
Implemented by
|
#
|
public
|
ceilHour(float $precision = 1): CarbonInterface
Ceil the current instance hour with given precision.
Ceil the current instance hour with given precision.
Implemented by
|
#
|
public
|
ceilHours(float $precision = 1): CarbonInterface
Ceil the current instance hour with given precision.
Ceil the current instance hour with given precision.
Implemented by
|
#
|
public
|
roundMinute(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance minute with given precision using the given function.
Round the current instance minute with given precision using the given function.
Implemented by
|
#
|
public
|
roundMinutes(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance minute with given precision using the given function.
Round the current instance minute with given precision using the given function.
Implemented by
|
#
|
public
|
floorMinute(float $precision = 1): CarbonInterface
Truncate the current instance minute with given precision.
Truncate the current instance minute with given precision.
Implemented by
|
#
|
public
|
floorMinutes(float $precision = 1): CarbonInterface
Truncate the current instance minute with given precision.
Truncate the current instance minute with given precision.
Implemented by
|
#
|
public
|
ceilMinute(float $precision = 1): CarbonInterface
Ceil the current instance minute with given precision.
Ceil the current instance minute with given precision.
Implemented by
|
#
|
public
|
ceilMinutes(float $precision = 1): CarbonInterface
Ceil the current instance minute with given precision.
Ceil the current instance minute with given precision.
Implemented by
|
#
|
public
|
roundSecond(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance second with given precision using the given function.
Round the current instance second with given precision using the given function.
Implemented by
|
#
|
public
|
roundSeconds(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance second with given precision using the given function.
Round the current instance second with given precision using the given function.
Implemented by
|
#
|
public
|
floorSecond(float $precision = 1): CarbonInterface
Truncate the current instance second with given precision.
Truncate the current instance second with given precision.
Implemented by
|
#
|
public
|
floorSeconds(float $precision = 1): CarbonInterface
Truncate the current instance second with given precision.
Truncate the current instance second with given precision.
Implemented by
|
#
|
public
|
ceilSecond(float $precision = 1): CarbonInterface
Ceil the current instance second with given precision.
Ceil the current instance second with given precision.
Implemented by
|
#
|
public
|
ceilSeconds(float $precision = 1): CarbonInterface
Ceil the current instance second with given precision.
Ceil the current instance second with given precision.
Implemented by
|
#
|
public
|
roundMillennium(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance millennium with given precision using the given function.
Round the current instance millennium with given precision using the given function.
Implemented by
|
#
|
public
|
roundMillennia(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance millennium with given precision using the given function.
Round the current instance millennium with given precision using the given function.
Implemented by
|
#
|
public
|
floorMillennium(float $precision = 1): CarbonInterface
Truncate the current instance millennium with given precision.
Truncate the current instance millennium with given precision.
Implemented by
|
#
|
public
|
floorMillennia(float $precision = 1): CarbonInterface
Truncate the current instance millennium with given precision.
Truncate the current instance millennium with given precision.
Implemented by
|
#
|
public
|
ceilMillennium(float $precision = 1): CarbonInterface
Ceil the current instance millennium with given precision.
Ceil the current instance millennium with given precision.
Implemented by
|
#
|
public
|
ceilMillennia(float $precision = 1): CarbonInterface
Ceil the current instance millennium with given precision.
Ceil the current instance millennium with given precision.
Implemented by
|
#
|
public
|
roundCentury(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance century with given precision using the given function.
Round the current instance century with given precision using the given function.
Implemented by
|
#
|
public
|
roundCenturies(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance century with given precision using the given function.
Round the current instance century with given precision using the given function.
Implemented by
|
#
|
public
|
floorCentury(float $precision = 1): CarbonInterface
Truncate the current instance century with given precision.
Truncate the current instance century with given precision.
Implemented by
|
#
|
public
|
floorCenturies(float $precision = 1): CarbonInterface
Truncate the current instance century with given precision.
Truncate the current instance century with given precision.
Implemented by
|
#
|
public
|
ceilCentury(float $precision = 1): CarbonInterface
Ceil the current instance century with given precision.
Ceil the current instance century with given precision.
Implemented by
|
#
|
public
|
ceilCenturies(float $precision = 1): CarbonInterface
Ceil the current instance century with given precision.
Ceil the current instance century with given precision.
Implemented by
|
#
|
public
|
roundDecade(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance decade with given precision using the given function.
Round the current instance decade with given precision using the given function.
Implemented by
|
#
|
public
|
roundDecades(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance decade with given precision using the given function.
Round the current instance decade with given precision using the given function.
Implemented by
|
#
|
public
|
floorDecade(float $precision = 1): CarbonInterface
Truncate the current instance decade with given precision.
Truncate the current instance decade with given precision.
Implemented by
|
#
|
public
|
floorDecades(float $precision = 1): CarbonInterface
Truncate the current instance decade with given precision.
Truncate the current instance decade with given precision.
Implemented by
|
#
|
public
|
ceilDecade(float $precision = 1): CarbonInterface
Ceil the current instance decade with given precision.
Ceil the current instance decade with given precision.
Implemented by
|
#
|
public
|
ceilDecades(float $precision = 1): CarbonInterface
Ceil the current instance decade with given precision.
Ceil the current instance decade with given precision.
Implemented by
|
#
|
public
|
roundQuarter(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance quarter with given precision using the given function.
Round the current instance quarter with given precision using the given function.
Implemented by
|
#
|
public
|
roundQuarters(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance quarter with given precision using the given function.
Round the current instance quarter with given precision using the given function.
Implemented by
|
#
|
public
|
floorQuarter(float $precision = 1): CarbonInterface
Truncate the current instance quarter with given precision.
Truncate the current instance quarter with given precision.
Implemented by
|
#
|
public
|
floorQuarters(float $precision = 1): CarbonInterface
Truncate the current instance quarter with given precision.
Truncate the current instance quarter with given precision.
Implemented by
|
#
|
public
|
ceilQuarter(float $precision = 1): CarbonInterface
Ceil the current instance quarter with given precision.
Ceil the current instance quarter with given precision.
Implemented by
|
#
|
public
|
ceilQuarters(float $precision = 1): CarbonInterface
Ceil the current instance quarter with given precision.
Ceil the current instance quarter with given precision.
Implemented by
|
#
|
public
|
roundMillisecond(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance millisecond with given precision using the given function.
Round the current instance millisecond with given precision using the given function.
Implemented by
|
#
|
public
|
roundMilliseconds(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance millisecond with given precision using the given function.
Round the current instance millisecond with given precision using the given function.
Implemented by
|
#
|
public
|
floorMillisecond(float $precision = 1): CarbonInterface
Truncate the current instance millisecond with given precision.
Truncate the current instance millisecond with given precision.
Implemented by
|
#
|
public
|
floorMilliseconds(float $precision = 1): CarbonInterface
Truncate the current instance millisecond with given precision.
Truncate the current instance millisecond with given precision.
Implemented by
|
#
|
public
|
ceilMillisecond(float $precision = 1): CarbonInterface
Ceil the current instance millisecond with given precision.
Ceil the current instance millisecond with given precision.
Implemented by
|
#
|
public
|
ceilMilliseconds(float $precision = 1): CarbonInterface
Ceil the current instance millisecond with given precision.
Ceil the current instance millisecond with given precision.
Implemented by
|
#
|
public
|
roundMicrosecond(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance microsecond with given precision using the given function.
Round the current instance microsecond with given precision using the given function.
Implemented by
|
#
|
public
|
roundMicroseconds(float $precision = 1, string $function = "\"round\""): CarbonInterface
Round the current instance microsecond with given precision using the given function.
Round the current instance microsecond with given precision using the given function.
Implemented by
|
#
|
public
|
floorMicrosecond(float $precision = 1): CarbonInterface
Truncate the current instance microsecond with given precision.
Truncate the current instance microsecond with given precision.
Implemented by
|
#
|
public
|
floorMicroseconds(float $precision = 1): CarbonInterface
Truncate the current instance microsecond with given precision.
Truncate the current instance microsecond with given precision.
Implemented by
|
#
|
public
|
ceilMicrosecond(float $precision = 1): CarbonInterface
Ceil the current instance microsecond with given precision.
Ceil the current instance microsecond with given precision.
Implemented by
|
#
|
public
|
ceilMicroseconds(float $precision = 1): CarbonInterface
Ceil the current instance microsecond with given precision.
Ceil the current instance microsecond with given precision.
Implemented by
|
#
|
public
|
shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1): string
Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts…
Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Implemented by
|
#
|
public
|
longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1): string
Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts…
Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Implemented by
|
#
|
public
|
shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1): string
Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts…
Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Implemented by
|
#
|
public
|
longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1): string
Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts…
Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Implemented by
|
#
|
public
|
shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1): string
Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and …
Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Implemented by
|
#
|
public
|
longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1): string
Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and …
Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Implemented by
|
#
|
public
|
shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1): string
Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and…
Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Implemented by
|
#
|
public
|
longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1): string
Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and …
Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Implemented by
|
#
|