interface CarbonInterface implementsDateTimeInterface,JsonSerializable
Common interface for Carbon and CarbonImmutable.
Constants
NO_ZERO_DIFF |
Diff wording options(expressed in octal). |
JUST_NOW |
|
ONE_DAY_WORDS |
|
TWO_DAY_WORDS |
|
SEQUENTIAL_PARTS_ONLY |
|
ROUND |
|
FLOOR |
|
CEIL |
|
DIFF_ABSOLUTE |
Diff syntax options. |
DIFF_RELATIVE_AUTO |
|
DIFF_RELATIVE_TO_NOW |
|
DIFF_RELATIVE_TO_OTHER |
|
TRANSLATE_MONTHS |
Translate string options. |
TRANSLATE_DAYS |
|
TRANSLATE_UNITS |
|
TRANSLATE_MERIDIEM |
|
TRANSLATE_DIFF |
|
TRANSLATE_ALL |
|
SUNDAY |
The day constants. |
MONDAY |
|
TUESDAY |
|
WEDNESDAY |
|
THURSDAY |
|
FRIDAY |
|
SATURDAY |
|
JANUARY |
The month constants. These aren't used by Carbon itself but exist for convenience sake alone. |
FEBRUARY |
|
MARCH |
|
APRIL |
|
MAY |
|
JUNE |
|
JULY |
|
AUGUST |
|
SEPTEMBER |
|
OCTOBER |
|
NOVEMBER |
|
DECEMBER |
|
YEARS_PER_MILLENNIUM |
Number of X in Y. |
YEARS_PER_CENTURY |
|
YEARS_PER_DECADE |
|
MONTHS_PER_YEAR |
|
MONTHS_PER_QUARTER |
|
QUARTERS_PER_YEAR |
|
WEEKS_PER_YEAR |
|
WEEKS_PER_MONTH |
|
DAYS_PER_YEAR |
|
DAYS_PER_WEEK |
|
HOURS_PER_DAY |
|
MINUTES_PER_HOUR |
|
SECONDS_PER_MINUTE |
|
MILLISECONDS_PER_SECOND |
|
MICROSECONDS_PER_MILLISECOND |
|
MICROSECONDS_PER_SECOND |
|
WEEK_DAY_AUTO |
Special settings to get the start of week from current locale culture. |
RFC7231_FORMAT |
RFC7231 DateTime format. |
DEFAULT_TO_STRING_FORMAT |
Default format to use for __toString method when type juggling occurs. |
MOCK_DATETIME_FORMAT |
Format for converting mocked time, includes microseconds. |
ISO_FORMAT_REGEXP |
Pattern detection for ->isoFormat and ::createFromIsoFormat. |
Properties
int | $year | ||
int | $yearIso | ||
int | $month | ||
int | $day | ||
int | $hour | ||
int | $minute | ||
int | $second | ||
int | $micro | ||
int | $microsecond | ||
int|float|string | $timestamp | seconds since the Unix Epoch | |
string | $englishDayOfWeek | the day of week in English | |
string | $shortEnglishDayOfWeek | the abbreviated day of week in English | |
string | $englishMonth | the month in English | |
string | $shortEnglishMonth | the abbreviated month in English | |
int | $milliseconds | ||
int | $millisecond | ||
int | $milli | ||
int | $week | 1 through 53 | |
int | $isoWeek | 1 through 53 | |
int | $weekYear | year according to week format | |
int | $isoWeekYear | year according to ISO week format | |
int | $dayOfYear | 1 through 366 | |
int | $age | does a diffInYears() with default parameters | |
int | $offset | the timezone offset in seconds from UTC | |
int | $offsetMinutes | the timezone offset in minutes from UTC | |
int | $offsetHours | the timezone offset in hours from UTC | |
CarbonTimeZone | $timezone | the current timezone | |
CarbonTimeZone | $tz | alias of $timezone |
Methods
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Update constructedObjectId on cloned.
Create a new Carbon instance.
Show truthy properties on var_dump().
Get a part of the Carbon object
Check if an attribute exists on the object
No description
Returns the list of properties to dump on serialize() called on.
Format the instance as a string using the set format
No description
Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.
Add given units to the current instance.
Add any unit to a new value without overflowing current other unit given.
Get the difference in a human readable format in the current locale from an other instance given to now
Modify the current instance to the average of a given instance (default now) and the current instance (second-precision).
Clone the current instance if it's mutable.
Determines if the instance is between two others.
Determines if the instance is between two others, bounds excluded.
Determines if the instance is between two others, bounds included.
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.
Checks if the (date)time string is in a given format and valid to create a new instance.
Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
Cast the current instance into the given class.
Ceil the current instance second with given precision if specified.
Ceil the current instance at the given unit with given precision if specified.
Ceil the current instance week.
Similar to native modify() method of DateTime but can handle more grammars.
Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.
No description
Get the closest date from the instance (second-precision).
Get a copy of the instance.
Create a new Carbon instance from a specific date and time.
Create a Carbon instance from just a date. The time portion is set to now.
No description
Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).
Create a Carbon instance from a specific format and a string in a given language.
Create a Carbon instance from a specific ISO format and a string in a given language.
Create a Carbon instance from just a time. The date portion is set to today.
Create a Carbon instance from a time string. The date portion is set to today.
Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).
Create a Carbon instance from a timestamp in milliseconds.
Create a Carbon instance from a timestamp in milliseconds.
Create a Carbon instance from an timestamp keeping the timezone to UTC.
Create a Carbon instance from just a date. The time portion is set to midnight.
Create a new safe Carbon instance from a specific date and time.
Create a new Carbon instance from a specific date and time using strict validation.
Get/set the day of year.
Get the difference as a CarbonInterval instance.
Get the difference by the given interval using a filter closure.
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).
Get the difference in days rounded down.
Get the difference in days using a filter closure rounded down.
Get the difference in hours rounded down.
Get the difference in hours using a filter closure rounded down.
Get the difference in microseconds.
Get the difference in milliseconds rounded down.
Get the difference in minutes rounded down.
Get the difference in months rounded down.
Get the difference in quarters rounded down.
Get the difference in hours rounded down using timestamps.
Get the difference in microseconds using timestamps.
Get the difference in milliseconds rounded down using timestamps.
Get the difference in minutes rounded down using timestamps.
Get the difference in seconds using timestamps.
Get the difference in seconds rounded down.
Get the difference in weekdays rounded down.
Get the difference in weekend days using a filter rounded down.
Get the difference in weeks rounded down.
Get the difference in years
Modify to end of current given unit.
Resets the date to end of the century and time to 23:59:59.999999
Resets the time to 23:59:59.999999 end of day
Resets the date to end of the decade and time to 23:59:59.999999
Modify to end of current hour, minutes and seconds become 59
Resets the date to end of the millennium and time to 23:59:59.999999
Modify to end of current minute, seconds become 59
Resets the date to end of the month and time to 23:59:59.999999
Resets the date to end of the quarter and time to 23:59:59.999999
Modify to end of current second, microseconds become 999999
Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
Resets the date to end of the year and time to 23:59:59.999999
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).
Get the farthest date from the instance (second-precision).
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.
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.
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.
Get the difference in days as float (microsecond-precision).
Get the difference in hours as float (microsecond-precision).
Get the difference in minutes as float (microsecond-precision).
Get the difference in months as float (microsecond-precision).
Get the difference in days as float (microsecond-precision).
Get the difference in hours as float (microsecond-precision) using timestamps.
Get the difference in minutes as float (microsecond-precision) using timestamps.
Get the difference in months as float (microsecond-precision) using timestamps.
Get the difference in seconds as float (microsecond-precision) using timestamps.
Get the difference in weeks as float (microsecond-precision).
Get the difference in year as float (microsecond-precision) using timestamps.
Get the difference in seconds as float (microsecond-precision).
Get the difference in weeks as float (microsecond-precision).
Get the difference in year as float (microsecond-precision).
Round the current instance second with given precision if specified.
Truncate the current instance at the given unit with given precision if specified.
Truncate the current instance week.
Format the instance with the current locale. You can set the current locale using setlocale() https://php.net/setlocale.
No description
Get the difference in a human readable format in the current locale from current instance to now.
Create an instance from a serialized string.
Register a custom macro.
Get a part of the Carbon object
Returns the alternative number for a given date property if available in the current locale.
Returns the list of internally available locales and already loaded custom locales.
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.
Returns list of calendar formats for ISO formatting.
Get the days of the week
Get the fallback locale.
List of replacements from date() format to isoFormat().
Return default humanDiff() options (merged flags as integer).
Returns list of locale formats for ISO formatting.
Returns list of locale units for ISO formatting.
No description
Get the raw callable macro registered globally or locally for a given name.
Get the translator of the current instance or the default if none set.
Get the current translator locale.
Get the raw callable macro registered globally for a given name.
get midday/noon hour
Returns the offset hour and minute formatted with +/- and a given separator (":" by default).
Returns a unit of the instance padded with 0 by default or any other string if specified.
Returns a timestamp rounded with the given precision (6 by default).
Returns current local settings.
Get the Carbon instance (real or mock) to be returned when a "now" instance is created.
Return a format from H:i to H:i:s.u according to given unit precision.
Returns the timestamp with millisecond precision.
Get the translation of the current 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).
Get the translation of the current month 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).
Get the translation of the current short month day name (with context for languages with multiple forms).
Returns raw translation message for a given key.
Returns raw translation message for a given key.
Get the default translator instance in use.
Get the last day of week
Get the first day of week
Get weekend days
Determines if the instance is greater (after) than another
Determines if the instance is greater (after) than or equal to another
Determines if the instance is greater (after) than or equal to another
Checks if the (date)time string is in a given format.
Checks if the (date)time string is in a given format.
Checks if macro is registered globally or locally.
Return true if the current instance has its own translator.
Checks if macro is registered globally.
Determine if a time string will produce a relative date.
Determine if there is a valid test instance set. A valid test instance is anything that is not null.
Returns true if the current date matches the given string.
Determines if the instance is greater (after) than another
Determines if the instance is less (before) than another
Determines if the instance is between two others
Check if its the birthday. Compares the date/month values of the two dates.
Determines if the instance is in the current unit given.
Checks if this day is a specific day of the week.
Check if the instance is end of day.
Returns true if the date was created using CarbonImmutable::endOfTime()
Determines if the instance is in the future, ie. greater (after) than now.
Returns true if the current class/instance is immutable.
Check if today is the last day of the Month
Determines if the instance is a leap year.
Determines if the instance is a long year
Check if the instance is midday.
Check if the instance is start of day / midnight.
Returns true if a property can be changed via setter.
Returns true if the current class/instance is mutable.
Determines if the instance is in the past, ie. less (before) than now.
Compares the formatted values of the two dates.
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 quarter as the instance quarter (and year if needed).
Determines if the instance is in the current unit given.
Check if the instance is start of day / midnight.
Returns true if the date was created using CarbonImmutable::startOfTime()
Returns true if the strict mode is globally in use, false else.
Determines if the instance is today.
Determines if the instance is tomorrow.
Determines if the instance is a weekday.
Determines if the instance is a weekend day.
Determines if the instance is yesterday.
Format in the current language using ISO replacement patterns.
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.
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.
Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
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.
No description
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.
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.
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.
Determines if the instance is less (before) than another
Determines if the instance is less (before) or equal to another
Get/set the locale for the current instance.
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 diff syntax support (ago, from now, before, after).
Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).
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 short-units support.
Determines if the instance is less (before) or equal to another
Register a custom macro.
Make a Carbon instance from given variable if possible.
Get the maximum instance between a given instance (default now) and the current instance.
Create a Carbon instance for the greatest supported date.
Get the maximum instance between a given instance (default now) and the current instance.
Return the meridiem of the current time in the current locale.
Modify to midday, default to self::$midDayAt
Get the minimum instance between a given instance (default now) and the current instance.
Create a Carbon instance for the lowest supported date.
Get the minimum instance between a given instance (default now) and the current instance.
Mix another object into the class.
No description
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.
Go forward to the next weekday.
Go forward to the next weekend day.
Returns a present instance in the same timezone.
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.
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.
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.
Return a property with its ordinal.
Create a carbon instance from a string.
Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).
Returns standardized plural of a given singular/plural unit name (in English).
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.
Go backward to the previous weekday.
Go backward to the previous weekend day.
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
Create a Carbon instance from a specific format.
No description
Create a carbon instance from a string.
Remove all macros and generic macros.
Reset the format used to the default when type juggling a Carbon instance to a string
Round the current instance second with given precision if specified.
Round the current instance at the given unit with given precision if specified and the given function.
Round the current instance week.
The number of seconds since midnight.
The number of seconds until 23:59:59.
Return a serialized string of the instance.
No description
Set the year, month, and date for this instance to that of the passed instance.
Set the date and time all together.
Set the date and time for this instance to that of the passed instance.
Set the fallback locale.
No description
Set the translator for the current instance.
Set the current translator locale and indicate if the source locale file exists.
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().
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().
No description
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
Set the time by time string.
No description
No description
Set the default translator instance to use.
Set specified unit to new given value.
Set any unit to a new value without overflowing current other unit given.
Set specific options.
Set the instance's timezone from a string or object and add/subtract the offset difference.
Get the month overflow global behavior (can be overridden in specific instances).
Get the month overflow global behavior (can be overridden in specific instances).
No description
Returns standardized singular of a given singular/plural unit name (in English).
Modify to start of current given unit.
Resets the date to the first day of the century and the time to 00:00:00
Resets the time to 00:00:00 start of day
Resets the date to the first day of the decade and the time to 00:00:00
Modify to start of current hour, minutes and seconds become 0
Resets the date to the first day of the millennium and the time to 00:00:00
Modify to start of current minute, seconds become 0
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 quarter and the time to 00:00:00
Modify to start of current second, microseconds become 0
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 the year and the time to 00:00:00
No description
No description
Subtract given units to the current instance.
Subtract any unit to a new value without overflowing current other unit given.
Subtract given units or interval to the current instance.
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).
Set the instance's timestamp.
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.
Get default array representation.
Format the instance as ATOM
Format the instance as COOKIE
Format the instance as date
Return native DateTime PHP object matching the current instance.
Return native toDateTimeImmutable PHP object matching the current instance.
Format the instance as date and time T-separated with no timezone
Format the instance as date and time
Format the instance with day, date and time
Format the instance as a readable date
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).
Return a immutable copy of the instance.
Format the instance as ISO8601
Convert the instance to UTC and return as Zulu ISO8601
Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone.
Get the difference in a human readable format in the current locale from an other instance given to now
Get default object representation.
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
Format the instance as RFC1036
Format the instance as RFC1123
Format the instance as RFC2822
Format the instance as RFC3339
Format the instance as RFC7231
Format the instance as RFC822
Format the instance as RFC850
Format the instance as RSS
Returns english human readable complete date string.
Format the instance as time
Format the instance as W3C
Translate using translation string or callback available.
Returns the alternative number for a given integer if available in the current locale.
Translate a time string from a locale to an other.
Translate a time string from the current locale ($date->locale()
) to an other.
Translate using translation string or callback available.
Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) but translate words whenever possible (months, day names, etc.) using the current locale.
Set the timezone or returns the timezone name if no arguments passed.
No description
No description
Set the instance's timezone to UTC.
Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
Returns the milliseconds timestamps used amongst other by Date javascript objects.
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).
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).
Get/set the weekday from 0 (Sunday) to 6 (Saturday).
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).
Temporarily sets a static date to be used within the callback.
Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
Check if the current instance has non-UTC timezone.
Check if the current instance is a valid date.
Check if the current instance is in a daylight saving time.
Checks if the instance day is sunday.
Checks if the instance day is monday.
Checks if the instance day is tuesday.
Checks if the instance day is wednesday.
Checks if the instance day is thursday.
Checks if the instance day is friday.
Checks if the instance day is saturday.
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 instance is in the same year as the current moment.
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 last year.
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 instance is in the same week as the current moment.
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 last week.
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 instance is in the same day as the current moment.
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 last day.
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 instance is in the same hour as the current moment.
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 last hour.
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 instance is in the same minute as the current moment.
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 last minute.
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 instance is in the same second as the current moment.
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 last second.
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
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 next microsecond.
Checks if the instance is in the same microsecond as the current moment last microsecond.
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
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 next microsecond.
Checks if the instance is in the same microsecond as the current moment last microsecond.
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 next month.
Checks if the instance is in the same month as the current moment last month.
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 next quarter.
Checks if the instance is in the same quarter as the current moment last quarter.
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 instance is in the same decade as the current moment.
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 last decade.
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 instance is in the same century as the current moment.
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 last century.
Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
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 next millennium.
Checks if the instance is in the same millennium as the current moment last millennium.
Set current instance year to the given value.
Set current instance year to the given value.
Set current instance year to the given value.
Set current instance year to the given value.
Set current instance month to the given value.
Set current instance month to the given value.
Set current instance month to the given value.
Set current instance month to the given value.
Set current instance day to the given value.
Set current instance day to the given value.
Set current instance day to the given value.
Set current instance day to the given value.
Set current instance hour to the given value.
Set current instance hour to the given value.
Set current instance hour to the given value.
Set current instance hour to the given value.
Set current instance minute to the given value.
Set current instance minute to the given value.
Set current instance minute to the given value.
Set current instance minute to the given value.
Set current instance second to the given value.
Set current instance second to the given value.
Set current instance second to the given value.
Set current instance second to the given value.
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Set current instance millisecond to the given value.
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Set current instance microsecond to the given value.
Add years (the $value count passed in) to the instance (using date interval).
Add one year to the instance (using date interval).
Sub years (the $value count passed in) to the instance (using date interval).
Sub one year to the instance (using date interval).
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add one year 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.
Sub one year 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 forbidden.
Add one year 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.
Sub one year 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.
Add one year 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.
Sub one year 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.
Add one year 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.
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
Add months (the $value count passed in) to the instance (using date interval).
Add one month to the instance (using date interval).
Sub months (the $value count passed in) to the instance (using date interval).
Sub one month to the instance (using date interval).
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add one month 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.
Sub one month 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 forbidden.
Add one month 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.
Sub one month 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.
Add one month 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.
Sub one month 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.
Add one month 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.
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
Add days (the $value count passed in) to the instance (using date interval).
Add one day to the instance (using date interval).
Sub days (the $value count passed in) to the instance (using date interval).
Sub one day to the instance (using date interval).
Add hours (the $value count passed in) to the instance (using date interval).
Add one hour to the instance (using date interval).
Sub hours (the $value count passed in) to the instance (using date interval).
Sub one hour to the instance (using date interval).
Add minutes (the $value count passed in) to the instance (using date interval).
Add one minute to the instance (using date interval).
Sub minutes (the $value count passed in) to the instance (using date interval).
Sub one minute to the instance (using date interval).
Add seconds (the $value count passed in) to the instance (using date interval).
Add one second to the instance (using date interval).
Sub seconds (the $value count passed in) to the instance (using date interval).
Sub one second to the instance (using date interval).
Add milliseconds (the $value count passed in) to the instance (using date interval).
Add one millisecond to the instance (using date interval).
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Sub one millisecond to the instance (using date interval).
Add milliseconds (the $value count passed in) to the instance (using date interval).
Add one millisecond to the instance (using date interval).
Sub milliseconds (the $value count passed in) to the instance (using date interval).
Sub one millisecond to the instance (using date interval).
Add microseconds (the $value count passed in) to the instance (using date interval).
Add one microsecond to the instance (using date interval).
Sub microseconds (the $value count passed in) to the instance (using date interval).
Sub one microsecond to the instance (using date interval).
Add microseconds (the $value count passed in) to the instance (using date interval).
Add one microsecond to the instance (using date interval).
Sub microseconds (the $value count passed in) to the instance (using date interval).
Sub one microsecond to the instance (using date interval).
Add millennia (the $value count passed in) to the instance (using date interval).
Add one millennium to the instance (using date interval).
Sub millennia (the $value count passed in) to the instance (using date interval).
Sub one millennium to the instance (using date interval).
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add one millennium 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.
Sub one millennium 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 forbidden.
Add one millennium 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.
Sub one millennium 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.
Add one millennium 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.
Sub one millennium 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.
Add one millennium 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.
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
Add centuries (the $value count passed in) to the instance (using date interval).
Add one century to the instance (using date interval).
Sub centuries (the $value count passed in) to the instance (using date interval).
Sub one century to the instance (using date interval).
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add one century 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.
Sub one century 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 forbidden.
Add one century 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.
Sub one century 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.
Add one century 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.
Sub one century 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.
Add one century 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.
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
Add decades (the $value count passed in) to the instance (using date interval).
Add one decade to the instance (using date interval).
Sub decades (the $value count passed in) to the instance (using date interval).
Sub one decade to the instance (using date interval).
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add one decade 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.
Sub one decade 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 forbidden.
Add one decade 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.
Sub one decade 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.
Add one decade 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.
Sub one decade 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.
Add one decade 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.
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
Add quarters (the $value count passed in) to the instance (using date interval).
Add one quarter to the instance (using date interval).
Sub quarters (the $value count passed in) to the instance (using date interval).
Sub one quarter to the instance (using date interval).
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
Add one quarter 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.
Sub one quarter 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 forbidden.
Add one quarter 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.
Sub one quarter 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.
Add one quarter 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.
Sub one quarter 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.
Add one quarter 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.
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
Add weeks (the $value count passed in) to the instance (using date interval).
Add one week to the instance (using date interval).
Sub weeks (the $value count passed in) to the instance (using date interval).
Sub one week to the instance (using date interval).
Add weekdays (the $value count passed in) to the instance (using date interval).
Add one weekday to the instance (using date interval).
Sub weekdays (the $value count passed in) to the instance (using date interval).
Sub one weekday to the instance (using date interval).
Add microseconds (the $value count passed in) to the instance (using timestamp).
Add one microsecond to the instance (using timestamp).
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Sub one microsecond to the instance (using timestamp).
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.
Add microseconds (the $value count passed in) to the instance (using timestamp).
Add one microsecond to the instance (using timestamp).
Sub microseconds (the $value count passed in) to the instance (using timestamp).
Sub one microsecond to the instance (using timestamp).
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.
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Add one millisecond to the instance (using timestamp).
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Sub one millisecond to the instance (using timestamp).
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.
Add milliseconds (the $value count passed in) to the instance (using timestamp).
Add one millisecond to the instance (using timestamp).
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
Sub one millisecond to the instance (using timestamp).
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.
Add seconds (the $value count passed in) to the instance (using timestamp).
Add one second to the instance (using timestamp).
Sub seconds (the $value count passed in) to the instance (using timestamp).
Sub one second to the instance (using timestamp).
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.
Add minutes (the $value count passed in) to the instance (using timestamp).
Add one minute to the instance (using timestamp).
Sub minutes (the $value count passed in) to the instance (using timestamp).
Sub one minute to the instance (using timestamp).
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.
Add hours (the $value count passed in) to the instance (using timestamp).
Add one hour to the instance (using timestamp).
Sub hours (the $value count passed in) to the instance (using timestamp).
Sub one hour to the instance (using timestamp).
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.
Add days (the $value count passed in) to the instance (using timestamp).
Add one day to the instance (using timestamp).
Sub days (the $value count passed in) to the instance (using timestamp).
Sub one day to the instance (using timestamp).
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.
Add weeks (the $value count passed in) to the instance (using timestamp).
Add one week to the instance (using timestamp).
Sub weeks (the $value count passed in) to the instance (using timestamp).
Sub one week to the instance (using timestamp).
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.
Add months (the $value count passed in) to the instance (using timestamp).
Add one month to the instance (using timestamp).
Sub months (the $value count passed in) to the instance (using timestamp).
Sub one month to the instance (using timestamp).
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.
Add quarters (the $value count passed in) to the instance (using timestamp).
Add one quarter to the instance (using timestamp).
Sub quarters (the $value count passed in) to the instance (using timestamp).
Sub one quarter to the instance (using timestamp).
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.
Add years (the $value count passed in) to the instance (using timestamp).
Add one year to the instance (using timestamp).
Sub years (the $value count passed in) to the instance (using timestamp).
Sub one year to the instance (using timestamp).
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.
Add decades (the $value count passed in) to the instance (using timestamp).
Add one decade to the instance (using timestamp).
Sub decades (the $value count passed in) to the instance (using timestamp).
Sub one decade to the instance (using timestamp).
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.
Add centuries (the $value count passed in) to the instance (using timestamp).
Add one century to the instance (using timestamp).
Sub centuries (the $value count passed in) to the instance (using timestamp).
Sub one century to the instance (using timestamp).
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.
Add millennia (the $value count passed in) to the instance (using timestamp).
Add one millennium to the instance (using timestamp).
Sub millennia (the $value count passed in) to the instance (using timestamp).
Sub one millennium to the instance (using timestamp).
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.
Round the current instance year with given precision using the given function.
Round the current instance year with given precision using the given function.
Truncate the current instance year with given precision.
Truncate the current instance year with given precision.
Ceil the current instance year with given precision.
Ceil the current instance year with given precision.
Round the current instance month with given precision using the given function.
Round the current instance month with given precision using the given function.
Truncate the current instance month with given precision.
Truncate the current instance month with given precision.
Ceil the current instance month with given precision.
Ceil the current instance month with given precision.
Round the current instance day with given precision using the given function.
Round the current instance day with given precision using the given function.
Truncate the current instance day with given precision.
Truncate the current instance day with given precision.
Ceil the current instance day with given precision.
Ceil the current instance day with given precision.
Round the current instance hour with given precision using the given function.
Round the current instance hour with given precision using the given function.
Truncate the current instance hour with given precision.
Truncate the current instance hour with given precision.
Ceil the current instance hour with given precision.
Ceil the current instance hour with given precision.
Round the current instance minute with given precision using the given function.
Round the current instance minute with given precision using the given function.
Truncate the current instance minute with given precision.
Truncate the current instance minute with given precision.
Ceil the current instance minute with given precision.
Ceil the current instance minute with given precision.
Round the current instance second with given precision using the given function.
Round the current instance second with given precision using the given function.
Truncate the current instance second with given precision.
Truncate the current instance second with given precision.
Ceil the current instance second with given precision.
Ceil the current instance second with given precision.
Round the current instance millennium with given precision using the given function.
Round the current instance millennium with given precision using the given function.
Truncate the current instance millennium with given precision.
Truncate the current instance millennium with given precision.
Ceil the current instance millennium with given precision.
Ceil the current instance millennium with given precision.
Round the current instance century with given precision using the given function.
Round the current instance century with given precision using the given function.
Truncate the current instance century with given precision.
Truncate the current instance century with given precision.
Ceil the current instance century with given precision.
Ceil the current instance century with given precision.
Round the current instance decade with given precision using the given function.
Round the current instance decade with given precision using the given function.
Truncate the current instance decade with given precision.
Truncate the current instance decade with given precision.
Ceil the current instance decade with given precision.
Ceil the current instance decade with given precision.
Round the current instance quarter with given precision using the given function.
Round the current instance quarter with given precision using the given function.
Truncate the current instance quarter with given precision.
Truncate the current instance quarter with given precision.
Ceil the current instance quarter with given precision.
Ceil the current instance quarter with given precision.
Round the current instance millisecond with given precision using the given function.
Round the current instance millisecond with given precision using the given function.
Truncate the current instance millisecond with given precision.
Truncate the current instance millisecond with given precision.
Ceil the current instance millisecond with given precision.
Ceil the current instance millisecond with given precision.
Round the current instance microsecond with given precision using the given function.
Round the current instance microsecond with given precision using the given function.
Truncate the current instance microsecond with given precision.
Truncate the current instance microsecond with given precision.
Ceil the current instance microsecond with given precision.
Ceil the current instance microsecond with given precision.
Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
Details
at line646
mixed
__call(string$method,array$parameters)
Dynamically handle calls to the class.
at line658
staticmixed
__callStatic(string$method,array$parameters)
Dynamically handle calls to the class.
at line663
__clone()
Update constructedObjectId on cloned.
at line676
__construct(DateTimeInterface|string|null$time =null,DateTimeZone|string|null$tz =null)
Create a new Carbon instance.
Please see the testing aids section (specifically static::setTestNow()) for more on the possibility of this constructor returning a test instance.
at line683
array
__debugInfo()
Show truthy properties on var_dump().
at line694
string|int|bool|DateTimeZone|null
__get(string$name)
Get a part of the Carbon object
at line703
bool
__isset(string$name)
Check if an attribute exists on the object
at line715
void
__set(string$name,string|int|DateTimeZone$value)
Set a part of the Carbon object
at line725
static
__set_state($dump)
at line732
array
__sleep()
Returns the list of properties to dump on serialize() called on.
at line744
string
__toString()
Format the instance as a string using the set format
at line760
add($unit,$value =1,$overflow =null)
at line771
CarbonInterface
addRealUnit(string$unit,int$value =1)
Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.
at line782
CarbonInterface
addUnit(string$unit,int$value =1,bool|null$overflow =null)
Add given units to the current instance.
at line793
CarbonInterface
addUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)
Add any unit to a new value without overflowing current other unit given.
at line823
string
ago(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given to now
at line833
CarbonInterface
average(Carbon|DateTimeInterface|null$date =null)
Modify the current instance to the average of a given instance (default now) and the current instance (second-precision).
at line843
CarbonInterface
avoidMutation()
Clone the current instance if it's mutable.
This method is convenient to ensure you don't mutate the initial object but avoid to make a useless copy of it if it's already immutable.
at line866
bool
between(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2,bool$equal =true)
Determines if the instance is between two others.
The third argument allow you to specify if bounds are included or not (true by default) but for when you including/excluding bounds may produce different results in your application, we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead.
at line883
bool
betweenExcluded(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)
Determines if the instance is between two others, bounds excluded.
at line900
bool
betweenIncluded(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)
Determines if the instance is between two others, bounds included.
at line913
string
calendar(Carbon|DateTimeInterface|string|null$referenceTime =null,array$formats =[])
Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, or a calendar date (e.g. "10/29/2017") otherwise.
Language, date and time formats will change according to the current locale.
at line930
staticbool
canBeCreatedFromFormat(string$date,string$format)
Checks if the (date)time string is in a given format and valid to create a new instance.
at line940
CarbonInterface
carbonize(Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null$date =null)
Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
at line949
DateTimeInterface
cast(string$className)
Cast the current instance into the given class.
at line958
CarbonInterface
ceil(float|int|string|DateInterval|null$precision =1)
Ceil the current instance second with given precision if specified.
at line968
CarbonInterface
ceilUnit(string$unit,float|int$precision =1)
Ceil the current instance at the given unit with given precision if specified.
at line977
CarbonInterface
ceilWeek(int$weekStartsAt =null)
Ceil the current instance week.
at line993
CarbonInterface
change(string$modifier)
Similar to native modify() method of DateTime but can handle more grammars.
at line1002
cleanupDumpProperties()
Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.
foreach ($date as $_) {} serializer($date) var_export($date) get_object_vars($date)
at line1011
CarbonInterface
clone()
at line1021
CarbonInterface
closest(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)
Get the closest date from the instance (second-precision).
at line1028
CarbonInterface
copy()
Get a copy of the instance.
at line1054
staticCarbonInterface|false
create(int|null$year =0,int|null$month =1,int|null$day =1,int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)
Create a new Carbon instance from a specific date and time.
If any of $year, $month or $day are set to null their now() values will be used.
If $hour is null it will be set to its now() value and the default values for $minute and $second will be their now() values.
If $hour is not null then the default values for $minute and $second will be 0.
at line1068
staticCarbonInterface
createFromDate(int|null$year =null,int|null$month =null,int|null$day =null,DateTimeZone|string|null$tz =null)
Create a Carbon instance from just a date. The time portion is set to now.
at line1082
static
createFromFormat($format,$time,$tz =null)
at line1097
staticCarbonInterface|false
createFromIsoFormat(string$format,string$time,DateTimeZone|string|false|null$tz =null,string|null$locale ='en',TranslatorInterface$translator =null)
Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).
at line1111
staticCarbonInterface|false
createFromLocaleFormat(string$format,string$locale,string$time,DateTimeZone|string|false|null$tz =null)
Create a Carbon instance from a specific format and a string in a given language.
at line1125
staticCarbonInterface|false
createFromLocaleIsoFormat(string$format,string$locale,string$time,DateTimeZone|string|false|null$tz =null)
Create a Carbon instance from a specific ISO format and a string in a given language.
at line1139
staticCarbonInterface
createFromTime(int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)
Create a Carbon instance from just a time. The date portion is set to today.
at line1151
staticCarbonInterface
createFromTimeString(string$time,DateTimeZone|string|null$tz =null)
Create a Carbon instance from a time string. The date portion is set to today.
at line1163
staticCarbonInterface
createFromTimestamp(float|int|string$timestamp,DateTimeZone|string|null$tz =null)
Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).
Timestamp input can be given as int, float or a string containing one or more numbers.
at line1175
staticCarbonInterface
createFromTimestampMs(float|int|string$timestamp,DateTimeZone|string|null$tz =null)
Create a Carbon instance from a timestamp in milliseconds.
Timestamp input can be given as int, float or a string containing one or more numbers.
at line1186
staticCarbonInterface
createFromTimestampMsUTC(float|int|string$timestamp)
Create a Carbon instance from a timestamp in milliseconds.
Timestamp input can be given as int, float or a string containing one or more numbers.
at line1197
staticCarbonInterface
createFromTimestampUTC(float|int|string$timestamp)
Create a Carbon instance from an timestamp keeping the timezone to UTC.
Timestamp input can be given as int, float or a string containing one or more numbers.
at line1211
staticCarbonInterface
createMidnightDate(int|null$year =null,int|null$month =null,int|null$day =null,DateTimeZone|string|null$tz =null)
Create a Carbon instance from just a date. The time portion is set to midnight.
at line1240
staticCarbonInterface|false
createSafe(int|null$year =null,int|null$month =null,int|null$day =null,int|null$hour =null,int|null$minute =null,int|null$second =null,DateTimeZone|string|null$tz =null)
Create a new safe Carbon instance from a specific date and time.
If any of $year, $month or $day are set to null their now() values will be used.
If $hour is null it will be set to its now() value and the default values for $minute and $second will be their now() values.
If $hour is not null then the default values for $minute and $second will be 0.
If one of the set values is not valid, an InvalidDateException will be thrown.
at line1259
staticCarbonInterface
createStrict(int|null$year =0,int|null$month =1,int|null$day =1,int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)
Create a new Carbon instance from a specific date and time using strict validation.
at line1268
CarbonInterface|int
dayOfYear(int|null$value =null)
Get/set the day of year.
at line1280
CarbonInterval
diffAsCarbonInterval(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference as a CarbonInterval instance.
Return relative interval (negative if $absolute flag is not set to true and the given date is before current one).
at line1292
int
diffFiltered(CarbonInterval$ci,Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference by the given interval using a filter closure.
at line1341
string
diffForHumans(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).
at line1351
int
diffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days rounded down.
at line1362
int
diffInDaysFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days using a filter closure rounded down.
at line1372
int
diffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours rounded down.
at line1383
int
diffInHoursFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours using a filter closure rounded down.
at line1393
int
diffInMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in microseconds.
at line1403
int
diffInMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in milliseconds rounded down.
at line1413
int
diffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes rounded down.
at line1423
int
diffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months rounded down.
at line1433
int
diffInQuarters(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in quarters rounded down.
at line1443
int
diffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours rounded down using timestamps.
at line1453
int
diffInRealMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in microseconds using timestamps.
at line1463
int
diffInRealMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in milliseconds rounded down using timestamps.
at line1473
int
diffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes rounded down using timestamps.
at line1483
int
diffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds using timestamps.
at line1493
int
diffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds rounded down.
at line1503
int
diffInWeekdays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weekdays rounded down.
at line1513
int
diffInWeekendDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weekend days using a filter rounded down.
at line1523
int
diffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks rounded down.
at line1533
int
diffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in years
at line1542
static
disableHumanDiffOption(int$humanDiffOption)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.
at line1551
static
enableHumanDiffOption(int$humanDiffOption)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.
at line1568
CarbonInterface
endOf(string$unit,array...$params)
Modify to end of current given unit.
at line1580
CarbonInterface
endOfCentury()
Resets the date to end of the century and time to 23:59:59.999999
at line1592
CarbonInterface
endOfDay()
Resets the time to 23:59:59.999999 end of day
at line1604
CarbonInterface
endOfDecade()
Resets the date to end of the decade and time to 23:59:59.999999
at line1616
CarbonInterface
endOfHour()
Modify to end of current hour, minutes and seconds become 59
at line1628
CarbonInterface
endOfMillennium()
Resets the date to end of the millennium and time to 23:59:59.999999
at line1640
CarbonInterface
endOfMinute()
Modify to end of current minute, seconds become 59
at line1652
CarbonInterface
endOfMonth()
Resets the date to end of the month and time to 23:59:59.999999
at line1664
CarbonInterface
endOfQuarter()
Resets the date to end of the quarter and time to 23:59:59.999999
at line1678
CarbonInterface
endOfSecond()
Modify to end of current second, microseconds become 999999
at line1694
CarbonInterface
endOfWeek(int$weekEndsAt =null)
Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
at line1706
CarbonInterface
endOfYear()
Resets the date to end of the year and time to 23:59:59.999999
at line1724
bool
eq(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is equal to another
at line1740
bool
equalTo(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is equal to another
at line1751
staticmixed
executeWithLocale(string$locale,callable$func)
Set the current locale to the given, execute the passed function, reset the locale to previous one, then return the result of the closure (or null if the closure was void).
at line1761
CarbonInterface
farthest(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)
Get the farthest date from the instance (second-precision).
at line1773
CarbonInterface
firstOfMonth(int|null$dayOfWeek =null)
Modify to the first occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the first day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line1785
CarbonInterface
firstOfQuarter(int|null$dayOfWeek =null)
Modify to the first occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the first day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line1797
CarbonInterface
firstOfYear(int|null$dayOfWeek =null)
Modify to the first occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the first day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line1807
float
floatDiffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days as float (microsecond-precision).
at line1817
float
floatDiffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours as float (microsecond-precision).
at line1827
float
floatDiffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes as float (microsecond-precision).
at line1837
float
floatDiffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months as float (microsecond-precision).
at line1847
float
floatDiffInRealDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days as float (microsecond-precision).
at line1857
float
floatDiffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours as float (microsecond-precision) using timestamps.
at line1867
float
floatDiffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes as float (microsecond-precision) using timestamps.
at line1877
float
floatDiffInRealMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months as float (microsecond-precision) using timestamps.
at line1887
float
floatDiffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds as float (microsecond-precision) using timestamps.
at line1897
float
floatDiffInRealWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks as float (microsecond-precision).
at line1907
float
floatDiffInRealYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in year as float (microsecond-precision) using timestamps.
at line1917
float
floatDiffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds as float (microsecond-precision).
at line1927
float
floatDiffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks as float (microsecond-precision).
at line1937
float
floatDiffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in year as float (microsecond-precision).
at line1946
CarbonInterface
floor(float|int|string|DateInterval|null$precision =1)
Round the current instance second with given precision if specified.
at line1956
CarbonInterface
floorUnit(string$unit,float|int$precision =1)
Truncate the current instance at the given unit with given precision if specified.
at line1965
CarbonInterface
floorWeek(int$weekStartsAt =null)
Truncate the current instance week.
at line1979
string
formatLocalized(string$format)deprecated
deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. Use ->isoFormat() instead. Deprecated since 2.55.0
Format the instance with the current locale. You can set the current locale using setlocale() https://php.net/setlocale.
at line2015
string
from(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
at line2045
string
fromNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from current instance to now.
at line2056
staticCarbonInterface
fromSerialized(string$value)
Create an instance from a serialized string.
at line2066
staticvoid
genericMacro(object|callable$macro,int$priority =0)
Register a custom macro.
at line2077
string|int|bool|DateTimeZone|null
get(string$name)
Get a part of the Carbon object
at line2086
string
getAltNumber(string$key)
Returns the alternative number for a given date property if available in the current locale.
at line2094
staticarray
getAvailableLocales()
Returns the list of internally available locales and already loaded custom locales.
(It will ignore custom translator dynamic loading.)
at line2102
staticLanguage[]
getAvailableLocalesInfo()
Returns list of Language object for each available locale. This object allow you to get the ISO name, native name, region and variant of the locale.
at line2111
array
getCalendarFormats(string|null$locale =null)
Returns list of calendar formats for ISO formatting.
at line2118
staticarray
getDays()
Get the days of the week
at line2127
staticstring|null
getFallbackLocale()
Get the fallback locale.
at line2134
staticarray
getFormatsToIsoReplacements()
List of replacements from date() format to isoFormat().
at line2141
staticint
getHumanDiffOptions()
Return default humanDiff() options (merged flags as integer).
at line2150
array
getIsoFormats(string|null$locale =null)
Returns list of locale formats for ISO formatting.
at line2157
staticarray
getIsoUnits()
Returns list of locale units for ISO formatting.
at line2165
static
getLastErrors()
at line2174
callable|null
getLocalMacro(string$name)
Get the raw callable macro registered globally or locally for a given name.
at line2181
TranslatorInterface
getLocalTranslator()
Get the translator of the current instance or the default if none set.
at line2188
staticstring
getLocale()
Get the current translator locale.
at line2197
staticcallable|null
getMacro(string$name)
Get the raw callable macro registered globally for a given name.
at line2204
staticint
getMidDayAt()
get midday/noon hour
at line2216
string
getOffsetString(string$separator =':')
Returns the offset hour and minute formatted with +/- and a given separator (":" by default).
For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something like "-12:00".
at line2228
string
getPaddedUnit(string$unit,int$length =2,string$padString ='0',int$padType =0)
Returns a unit of the instance padded with 0 by default or any other string if specified.
at line2248
float
getPreciseTimestamp(int$precision =6)
Returns a timestamp rounded with the given precision (6 by default).
at line2255
array
getSettings()
Returns current local settings.
at line2263
staticClosure|CarbonInterface
getTestNow()
Get the Carbon instance (real or mock) to be returned when a "now" instance is created.
at line2272
staticstring
getTimeFormatByPrecision(string$unitPrecision)
Return a format from H:i to H:i:s.u according to given unit precision.
at line2279
int
getTimestampMs()
Returns the timestamp with millisecond precision.
at line2290
string
getTranslatedDayName(string|null$context =null,string$keySuffix ='',string|null$defaultValue =null)
Get the translation of the current week day name (with context for languages with multiple forms).
at line2299
string
getTranslatedMinDayName(string|null$context =null)
Get the translation of the current abbreviated week day name (with context for languages with multiple forms).
at line2310
string
getTranslatedMonthName(string|null$context =null,string$keySuffix ='',string|null$defaultValue =null)
Get the translation of the current month day name (with context for languages with multiple forms).
at line2319
string
getTranslatedShortDayName(string|null$context =null)
Get the translation of the current short week day name (with context for languages with multiple forms).
at line2328
string
getTranslatedShortMonthName(string|null$context =null)
Get the translation of the current short month day name (with context for languages with multiple forms).
at line2340
string
getTranslationMessage(string$key,string|null$locale =null,string|null$default =null,TranslatorInterface$translator =null)
Returns raw translation message for a given key.
at line2352
staticstring
getTranslationMessageWith(TranslatorInterface$translator,string$key,string|null$locale =null,string|null$default =null)
Returns raw translation message for a given key.
at line2359
staticTranslatorInterface
getTranslator()
Get the default translator instance in use.
at line2366
staticint
getWeekEndsAt()
Get the last day of week
at line2373
staticint
getWeekStartsAt()
Get the first day of week
at line2380
staticarray
getWeekendDays()
Get weekend days
at line2396
bool
greaterThan(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than another
at line2412
bool
greaterThanOrEqualTo(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than or equal to another
at line2430
bool
gt(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than another
at line2448
bool
gte(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than or equal to another
at line2464
staticbool
hasFormat(string$date,string$format)
Checks if the (date)time string is in a given format.
at line2480
staticbool
hasFormatWithModifiers(string$date,string$format)
Checks if the (date)time string is in a given format.
at line2489
bool
hasLocalMacro(string$name)
Checks if macro is registered globally or locally.
at line2496
bool
hasLocalTranslator()
Return true if the current instance has its own translator.
at line2505
staticbool
hasMacro(string$name)
Checks if macro is registered globally.
at line2514
staticbool
hasRelativeKeywords(string$time)
Determine if a time string will produce a relative date.
at line2522
staticbool
hasTestNow()
Determine if there is a valid test instance set. A valid test instance is anything that is not null.
at line2531
staticCarbonInterface
instance(DateTimeInterface$date)
Create a Carbon instance from a DateTime one.
at line2557
bool
is(string$tester)
Returns true if the current date matches the given string.
at line2575
bool
isAfter(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than another
at line2593
bool
isBefore(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) than another
at line2612
bool
isBetween(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2,bool$equal =true)
Determines if the instance is between two others
at line2629
bool
isBirthday(Carbon|DateTimeInterface|null$date =null)
Check if its the birthday. Compares the date/month values of the two dates.
at line2646
bool
isCurrentUnit(string$unit)
Determines if the instance is in the current unit given.
at line2663
bool
isDayOfWeek(int$dayOfWeek)
Checks if this day is a specific day of the week.
at line2683
bool
isEndOfDay(bool$checkMicroseconds =false)
Check if the instance is end of day.
at line2690
bool
isEndOfTime()
Returns true if the date was created using CarbonImmutable::endOfTime()
at line2703
bool
isFuture()
Determines if the instance is in the future, ie. greater (after) than now.
at line2710
staticbool
isImmutable()
Returns true if the current class/instance is immutable.
at line2726
bool
isLastOfMonth()
Check if today is the last day of the Month
at line2739
bool
isLeapYear()
Determines if the instance is a leap year.
at line2754
bool
isLongYear()
Determines if the instance is a long year
at line2769
bool
isMidday()
Check if the instance is midday.
at line2783
bool
isMidnight()
Check if the instance is start of day / midnight.
at line2792
staticbool
isModifiableUnit(string$unit)
Returns true if a property can be changed via setter.
at line2799
staticbool
isMutable()
Returns true if the current class/instance is mutable.
at line2812
bool
isPast()
Determines if the instance is in the past, ie. less (before) than now.
at line2828
bool
isSameAs(string$format,Carbon|DateTimeInterface|string|null$date =null)
Compares the formatted values of the two dates.
at line2846
bool
isSameMonth(Carbon|DateTimeInterface|null$date =null,bool$ofSameYear =true)
Checks if the passed in date is in the same month as the instance´s month.
at line2864
bool
isSameQuarter(Carbon|DateTimeInterface|string|null$date =null,bool$ofSameYear =true)
Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).
at line2882
bool
isSameUnit(string$unit,Carbon|DateTimeInterface|null$date =null)
Determines if the instance is in the current unit given.
at line2900
bool
isStartOfDay(bool$checkMicroseconds =false)
Check if the instance is start of day / midnight.
at line2907
bool
isStartOfTime()
Returns true if the date was created using CarbonImmutable::startOfTime()
at line2915
staticbool
isStrictModeEnabled()
Returns true if the strict mode is globally in use, false else.
(It can be overridden in specific instances.)
at line2928
bool
isToday()
Determines if the instance is today.
at line2941
bool
isTomorrow()
Determines if the instance is tomorrow.
at line2954
bool
isWeekday()
Determines if the instance is a weekday.
at line2967
bool
isWeekend()
Determines if the instance is a weekend day.
at line2980
bool
isYesterday()
Determines if the instance is yesterday.
at line2990
string
isoFormat(string$format,string|null$originalFormat =null)
Format in the current language using ISO replacement patterns.
at line3003
int|CarbonInterface
isoWeek(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)
Get/set the week number using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
at line3016
int|CarbonInterface
isoWeekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)
Set/get the week number of year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
at line3025
CarbonInterface|int
isoWeekday(int|null$value =null)
Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
at line3037
int
isoWeeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)
Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
at line3045
jsonSerialize()
at line3057
CarbonInterface
lastOfMonth(int|null$dayOfWeek =null)
Modify to the last occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the last day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line3069
CarbonInterface
lastOfQuarter(int|null$dayOfWeek =null)
Modify to the last occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the last day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line3081
CarbonInterface
lastOfYear(int|null$dayOfWeek =null)
Modify to the last occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the last day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line3097
bool
lessThan(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) than another
at line3113
bool
lessThanOrEqualTo(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) or equal to another
at line3123
$this|string
locale(string|null$locale =null,string...$fallbackLocales)
Get/set the locale for the current instance.
at line3133
staticbool
localeHasDiffOneDayWords(string$locale)
Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).
Support is considered enabled if the 3 words are translated in the given locale.
at line3143
staticbool
localeHasDiffSyntax(string$locale)
Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).
Support is considered enabled if the 4 sentences are translated in the given locale.
at line3153
staticbool
localeHasDiffTwoDayWords(string$locale)
Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).
Support is considered enabled if the 2 words are translated in the given locale.
at line3163
staticbool
localeHasPeriodSyntax(string$locale)
Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).
Support is considered enabled if the 4 sentences are translated in the given locale.
at line3173
staticbool
localeHasShortUnits(string$locale)
Returns true if the given locale is internally supported and has short-units support.
Support is considered enabled if either year, day or hour has a short variant translated.
at line3191
bool
lt(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) than another
at line3209
bool
lte(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) or equal to another
at line3231
staticvoid
macro(string$name,object|callable$macro)
Register a custom macro.
at line3245
staticCarbonInterface|null
make(mixed$var)
Make a Carbon instance from given variable if possible.
Always return a new instance. Parse only strings and only these likely to be dates (skip intervals and recurrences). Throw an exception for invalid format, but otherwise return null.
at line3254
CarbonInterface
max(Carbon|DateTimeInterface|mixed$date =null)
Get the maximum instance between a given instance (default now) and the current instance.
at line3261
staticCarbonInterface
maxValue()
Create a Carbon instance for the greatest supported date.
at line3272
CarbonInterface
maximum(Carbon|DateTimeInterface|mixed$date =null)
Get the maximum instance between a given instance (default now) and the current instance.
at line3281
string
meridiem(bool$isLower =false)
Return the meridiem of the current time in the current locale.
at line3288
CarbonInterface
midDay()
Modify to midday, default to self::$midDayAt
at line3297
CarbonInterface
min(Carbon|DateTimeInterface|mixed$date =null)
Get the minimum instance between a given instance (default now) and the current instance.
at line3304
staticCarbonInterface
minValue()
Create a Carbon instance for the lowest supported date.
at line3315
CarbonInterface
minimum(Carbon|DateTimeInterface|mixed$date =null)
Get the minimum instance between a given instance (default now) and the current instance.
at line3348
staticvoid
mixin(object|string$mixin)
Mix another object into the class.
at line3358
modify($modify)
at line3376
bool
ne(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is not equal to another
at line3388
CarbonInterface
next(string|int|null$modifier =null)
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.
at line3395
CarbonInterface
nextWeekday()
Go forward to the next weekday.
at line3402
CarbonInterface
nextWeekendDay()
Go forward to the next weekend day.
at line3418
bool
notEqualTo(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is not equal to another
at line3427
staticCarbonInterface
now(DateTimeZone|string|null$tz =null)
Get a Carbon instance for the current date and time.
at line3434
CarbonInterface
nowWithSameTz()
Returns a present instance in the same timezone.
at line3447
mixed
nthOfMonth(int$nth,int$dayOfWeek)
Modify to the given occurrence of a given day of the week in the current month. If the calculated occurrence is outside the scope of the current month, then return false and no modifications are made.
Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line3460
mixed
nthOfQuarter(int$nth,int$dayOfWeek)
Modify to the given occurrence of a given day of the week in the current quarter. If the calculated occurrence is outside the scope of the current quarter, then return false and no modifications are made.
Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line3473
mixed
nthOfYear(int$nth,int$dayOfWeek)
Modify to the given occurrence of a given day of the week in the current year. If the calculated occurrence is outside the scope of the current year, then return false and no modifications are made.
Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line3483
string
ordinal(string$key,string|null$period =null)
Return a property with its ordinal.
at line3499
staticCarbonInterface
parse(string|DateTimeInterface|null$time =null,DateTimeZone|string|null$tz =null)
Create a carbon instance from a string.
This is an alias for the constructor that allows better fluent syntax as it allows you to do Carbon::parse('Monday next week')->fn() rather than (new Carbon('Monday next week'))->fn().
at line3513
staticCarbonInterface
parseFromLocale(string$time,string|null$locale =null,DateTimeZone|string|null$tz =null)
Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).
at line3522
staticstring
pluralUnit(string$unit)
Returns standardized plural of a given singular/plural unit name (in English).
at line3534
CarbonInterface
previous(string|int|null$modifier =null)
Modify to the previous occurrence of a given modifier such as a day of the week. If no dayOfWeek is provided, modify to the previous occurrence of the current day of the week. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
at line3541
CarbonInterface
previousWeekday()
Go backward to the previous weekday.
at line3548
CarbonInterface
previousWeekendDay()
Go backward to the previous weekend day.
at line3559
CarbonPeriod
range(DateTimeInterface|Carbon|CarbonImmutable|null$end =null,int|DateInterval|string|null$interval =null,string|null$unit =null)
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
at line3568
CarbonInterface
rawAdd(DateInterval$interval)
Call native PHP DateTime/DateTimeImmutable add() method.
at line3581
staticCarbonInterface|false
rawCreateFromFormat(string$format,string$time,DateTimeZone|string|false|null$tz =null)
Create a Carbon instance from a specific format.
at line3590
string
rawFormat(string$format)
at line3606
staticCarbonInterface
rawParse(string|DateTimeInterface|null$time =null,DateTimeZone|string|null$tz =null)
Create a carbon instance from a string.
This is an alias for the constructor that allows better fluent syntax as it allows you to do Carbon::parse('Monday next week')->fn() rather than (new Carbon('Monday next week'))->fn().
at line3615
CarbonInterface
rawSub(DateInterval$interval)
Call native PHP DateTime/DateTimeImmutable sub() method.
at line3620
static
resetMacros()
Remove all macros and generic macros.
at line3633
staticvoid
resetMonthsOverflow()deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).
at line3640
staticvoid
resetToStringFormat()
Reset the format used to the default when type juggling a Carbon instance to a string
at line3653
staticvoid
resetYearsOverflow()deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).
at line3663
CarbonInterface
round(float|int|string|DateInterval|null$precision =1,string$function ='round')
Round the current instance second with given precision if specified.
at line3674
CarbonInterface
roundUnit(string$unit,float|int$precision =1,string$function ='round')
Round the current instance at the given unit with given precision if specified and the given function.
at line3683
CarbonInterface
roundWeek(int$weekStartsAt =null)
Round the current instance week.
at line3690
int
secondsSinceMidnight()
The number of seconds since midnight.
at line3697
int
secondsUntilEndOfDay()
The number of seconds until 23:59:59.
at line3704
string
serialize()
Return a serialized string of the instance.
at line3716
staticvoid
serializeUsing(callable$callback)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather transform Carbon object before the serialization. JSON serialize all Carbon instances using the given callback.
at line3728
$this
set(string|array$name,string|int|DateTimeZone$value =null)
Set a part of the Carbon object
at line3742
setDate($year,$month,$day)
at line3751
CarbonInterface
setDateFrom(Carbon|DateTimeInterface$date =null)
Set the year, month, and date for this instance to that of the passed instance.
at line3766
CarbonInterface
setDateTime(int$year,int$month,int$day,int$hour,int$minute,int$second =0,int$microseconds =0)
Set the date and time all together.
at line3775
CarbonInterface
setDateTimeFrom(Carbon|DateTimeInterface$date =null)
Set the date and time for this instance to that of the passed instance.
at line3784
static
setFallbackLocale(string$locale)
Set the fallback locale.
at line3793
static
setHumanDiffOptions(int$humanDiffOptions)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.
at line3807
setISODate($year,$week,$day =1)
at line3816
$this
setLocalTranslator(TranslatorInterface$translator)
Set the translator for the current instance.
at line3826
staticbool
setLocale(string$locale)
Set the current translator locale and indicate if the source locale file exists.
Pass 'auto' as locale to use closest language from the current LC_TIME locale.
at line3842
staticvoid
setMidDayAt(int$hour)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider mid-day is always 12pm, then if you need to test if it's an other hour, test it explicitly: $date->format('G') == 13 or to set explicitly to a given hour: $date->setTime(13, 0, 0, 0) Set midday/noon hour
at line3866
static
setTestNow(Closure|CarbonInterface|string|false|null$testNow =null)
Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: - A call to the static now() method, ex. Carbon::now() - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - When a string containing the desired time is passed to Carbon::parse().
Note the timezone parameter was left out of the examples above and has no affect as the mock value will be returned regardless of its value.
Only the moment is mocked with setTestNow(), the timezone will still be the one passed as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()).
To clear the test instance call this method using the default parameter of null.
/!\ Use this method for unit tests only.
at line3887
static
setTestNowAndTimezone($testNow =null,$tz =null)
Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: - A call to the static now() method, ex. Carbon::now() - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - When a string containing the desired time is passed to Carbon::parse().
It will also align default timezone (e.g. call date_default_timezone_set()) with the second argument or if null, with the timezone of the given date object.
To clear the test instance call this method using the default parameter of null.
/!\ Use this method for unit tests only.
at line3902
setTime($hour,$minute,$second =0,$microseconds =0)
at line3911
CarbonInterface
setTimeFrom(Carbon|DateTimeInterface$date =null)
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
at line3920
CarbonInterface
setTimeFromTimeString(string$time)
Set the time by time string.
at line3932
setTimestamp($unixTimestamp)
at line3942
setTimezone($value)
at line3956
staticvoid
setToStringFormat(string|Closure|null$format)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and use other method or custom format passed to format() method if you need to dump an other string format. Set the default format used when type juggling a Carbon instance to a string
at line3965
staticvoid
setTranslator(TranslatorInterface$translator)
Set the default translator instance to use.
at line3975
CarbonInterface
setUnit(string$unit,int$value =null)
Set specified unit to new given value.
at line3986
CarbonInterface
setUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)
Set any unit to a new value without overflowing current other unit given.
at line3996
static
setUtf8(bool$utf8)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use UTF-8 language packages on every machine. Set if UTF8 will be used for localized date/time.
at line4011
staticvoid
setWeekEndsAt(int|string$day)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the start of week according to current locale selected and implicitly the end of week. Set the last day of week
at line4025
staticvoid
setWeekStartsAt(int|string$day)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the 'first_day_of_week' locale setting to change the start of week according to current locale selected and implicitly the end of week. Set the first day of week
at line4054
staticvoid
setWeekendDays(array$days)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider week-end is always saturday and sunday, and if you have some custom week-end days to handle, give to those days an other name and create a macro for them: ``` Carbon::macro('isDayOff', function ($date) { return $date->isSunday() || $date->isMonday(); }); Carbon::macro('isNotDayOff', function ($date) { return !$date->isDayOff(); }); if ($someDate->isDayOff()) ... if ($someDate->isNotDayOff()) ... // Add 5 not-off days $count = 5; while ($someDate->isDayOff() || ($count-- > 0)) { $someDate->addDay(); } ``` Set weekend days
at line4073
$this|CarbonInterface
settings(array$settings)
Set specific options.
- strictMode: true|false|null
- monthOverflow: true|false|null
- yearOverflow: true|false|null
- humanDiffOptions: int|null
- toStringFormat: string|Closure|null
- toJsonFormat: string|Closure|null
- locale: string|null
- timezone: \DateTimeZone|string|int|null
- macros: array|null
- genericMacros: array|null
at line4082
CarbonInterface
shiftTimezone(DateTimeZone|string$value)
Set the instance's timezone from a string or object and add/subtract the offset difference.
at line4089
staticbool
shouldOverflowMonths()
Get the month overflow global behavior (can be overridden in specific instances).
at line4096
staticbool
shouldOverflowYears()
Get the month overflow global behavior (can be overridden in specific instances).
at line4104
since($other =null,$syntax =null,$short =false,$parts =1,$options =null)
at line4113
staticstring
singularUnit(string$unit)
Returns standardized singular of a given singular/plural unit name (in English).
at line4130
CarbonInterface
startOf(string$unit,array...$params)
Modify to start of current given unit.
at line4142
CarbonInterface
startOfCentury()
Resets the date to the first day of the century and the time to 00:00:00
at line4154
CarbonInterface
startOfDay()
Resets the time to 00:00:00 start of day
at line4166
CarbonInterface
startOfDecade()
Resets the date to the first day of the decade and the time to 00:00:00
at line4178
CarbonInterface
startOfHour()
Modify to start of current hour, minutes and seconds become 0
at line4190
CarbonInterface
startOfMillennium()
Resets the date to the first day of the millennium and the time to 00:00:00
at line4202
CarbonInterface
startOfMinute()
Modify to start of current minute, seconds become 0
at line4214
CarbonInterface
startOfMonth()
Resets the date to the first day of the month and the time to 00:00:00
at line4226
CarbonInterface
startOfQuarter()
Resets the date to the first day of the quarter and the time to 00:00:00
at line4240
CarbonInterface
startOfSecond()
Modify to start of current second, microseconds become 0
at line4256
CarbonInterface
startOfWeek(int$weekStartsAt =null)
Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
at line4268
CarbonInterface
startOfYear()
Resets the date to the first day of the year and the time to 00:00:00
at line4284
sub($unit,$value =1,$overflow =null)
at line4286
subRealUnit($unit,$value =1)
at line4297
CarbonInterface
subUnit(string$unit,int$value =1,bool|null$overflow =null)
Subtract given units to the current instance.
at line4308
CarbonInterface
subUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)
Subtract any unit to a new value without overflowing current other unit given.
at line4321
CarbonInterface
subtract(string|DateInterval$unit,int$value =1,bool|null$overflow =null)
Subtract given units or interval to the current instance.
at line4329
string
timespan($other =null,$timezone =null)
Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).
at line4340
CarbonInterface
timestamp(float|int|string$unixTimestamp)
Set the instance's timestamp.
Timestamp input can be given as int, float or a string containing one or more numbers.
at line4349
CarbonInterface
timezone(DateTimeZone|string$value)
at line4399
string
to(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given (or now if null given) to current instance.
When comparing a value in the past to default now: 1 hour from now 5 months from now
When comparing a value in the future to default now: 1 hour ago 5 months ago
When comparing a value in the past to another value: 1 hour after 5 months after
When comparing a value in the future to another value: 1 hour before 5 months before
at line4411
array
toArray()
Get default array representation.
at line4423
string
toAtomString()
Format the instance as ATOM
at line4435
string
toCookieString()
Format the instance as COOKIE
at line4449
DateTime
toDate()
at line4461
string
toDateString()
Format the instance as date
at line4473
DateTime
toDateTime()
Return native DateTime PHP object matching the current instance.
at line4485
DateTimeImmutable
toDateTimeImmutable()
Return native toDateTimeImmutable PHP object matching the current instance.
at line4501
string
toDateTimeLocalString(string$unitPrecision ='second')
Format the instance as date and time T-separated with no timezone
at line4515
string
toDateTimeString(string$unitPrecision ='second')
Format the instance as date and time
at line4527
string
toDayDateTimeString()
Format the instance with day, date and time
at line4539
string
toFormattedDateString()
Format the instance as a readable date
at line4555
null|string
toISOString(bool$keepOffset =false)
Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: 1977-04-22T01:00:00-05:00).
at line4562
CarbonImmutable
toImmutable()
Return a immutable copy of the instance.
at line4574
string
toIso8601String()
Format the instance as ISO8601
at line4588
string
toIso8601ZuluString(string$unitPrecision ='second')
Convert the instance to UTC and return as Zulu ISO8601
at line4600
null|string
toJSON()
Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone.
at line4607
Carbon
toMutable()
Return a mutable copy of the instance.
at line4637
string
toNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given to now
at line4649
object
toObject()
Get default object representation.
at line4660
CarbonPeriod
toPeriod(DateTimeInterface|Carbon|CarbonImmutable|int|null$end =null,int|DateInterval|string|null$interval =null,string|null$unit =null)
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
at line4672
string
toRfc1036String()
Format the instance as RFC1036
at line4684
string
toRfc1123String()
Format the instance as RFC1123
at line4696
string
toRfc2822String()
Format the instance as RFC2822
at line4711
string
toRfc3339String(bool$extended =false)
Format the instance as RFC3339
at line4723
string
toRfc7231String()
Format the instance as RFC7231
at line4735
string
toRfc822String()
Format the instance as RFC822
at line4747
string
toRfc850String()
Format the instance as RFC850
at line4759
string
toRssString()
Format the instance as RSS
at line4771
string
toString()
Returns english human readable complete date string.
at line4785
string
toTimeString(string$unitPrecision ='second')
Format the instance as time
at line4797
string
toW3cString()
Format the instance as W3C
at line4806
staticCarbonInterface
today(DateTimeZone|string|null$tz =null)
Create a Carbon instance for today.
at line4815
staticCarbonInterface
tomorrow(DateTimeZone|string|null$tz =null)
Create a Carbon instance for tomorrow.
at line4828
string
translate(string$key,array$parameters =[],string|int|float|null$number =null,TranslatorInterface|null$translator =null,bool$altNumbers =false)
Translate using translation string or callback available.
at line4837
string
translateNumber(int$number)
Returns the alternative number for a given integer if available in the current locale.
at line4855
staticstring
translateTimeString(string$timeString,string|null$from =null,string|null$to =null,int$mode =self::TRANSLATE_ALL)
Translate a time string from a locale to an other.
at line4865
string
translateTimeStringTo(string$timeString,string|null$to =null)
Translate a time string from the current locale ($date->locale()
) to an other.
at line4877
staticstring
translateWith(TranslatorInterface$translator,string$key,array$parameters =[],null$number =null)
Translate using translation string or callback available.
at line4887
string
translatedFormat(string$format)
Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) but translate words whenever possible (months, day names, etc.) using the current locale.
at line4896
CarbonInterface|string
tz(DateTimeZone|string$value =null)
Set the timezone or returns the timezone name if no arguments passed.
at line4905
int
unix()
at line4941
string
until(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
at line4956
staticvoid
useMonthsOverflow(bool$monthsOverflow =true)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).
at line4967
static
useStrictMode(bool$strictModeEnabled =true)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.
at line4982
staticvoid
useYearsOverflow(bool$yearsOverflow =true)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).
at line4989
CarbonInterface
utc()
Set the instance's timezone to UTC.
at line4998
int|CarbonInterface
utcOffset(int|null$minuteOffset =null)
Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
at line5005
float
valueOf()
Returns the milliseconds timestamps used amongst other by Date javascript objects.
at line5018
int|CarbonInterface
week(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)
Get/set the week number using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
at line5031
int|CarbonInterface
weekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)
Set/get the week number of year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
at line5040
CarbonInterface|int
weekday(int|null$value =null)
Get/set the weekday from 0 (Sunday) to 6 (Saturday).
at line5052
int
weeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)
Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
at line5066
staticmixed
withTestNow(Closure|CarbonInterface|string|false|null$testNow =null,Closure|null$callback =null)
Temporarily sets a static date to be used within the callback.
Using setTestNow to set the date, executing the callback, then clearing the test instance.
/!\ Use this method for unit tests only.
at line5075
staticCarbonInterface
yesterday(DateTimeZone|string|null$tz =null)
Create a Carbon instance for yesterday.
at line520
bool
isUtc()
Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
at line520
bool
isLocal()
Check if the current instance has non-UTC timezone.
at line520
bool
isValid()
Check if the current instance is a valid date.
at line520
bool
isDST()
Check if the current instance is in a daylight saving time.
at line520
bool
isSunday()
Checks if the instance day is sunday.
at line520
bool
isMonday()
Checks if the instance day is monday.
at line520
bool
isTuesday()
Checks if the instance day is tuesday.
at line520
bool
isWednesday()
Checks if the instance day is wednesday.
at line520
bool
isThursday()
Checks if the instance day is thursday.
at line520
bool
isFriday()
Checks if the instance day is friday.
at line520
bool
isSaturday()
Checks if the instance day is saturday.
at line520
bool
isSameYear(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentYear()
Checks if the instance is in the same year as the current moment.
at line520
bool
isNextYear()
Checks if the instance is in the same year as the current moment next year.
at line520
bool
isLastYear()
Checks if the instance is in the same year as the current moment last year.
at line520
bool
isSameWeek(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentWeek()
Checks if the instance is in the same week as the current moment.
at line520
bool
isNextWeek()
Checks if the instance is in the same week as the current moment next week.
at line520
bool
isLastWeek()
Checks if the instance is in the same week as the current moment last week.
at line520
bool
isSameDay(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentDay()
Checks if the instance is in the same day as the current moment.
at line520
bool
isNextDay()
Checks if the instance is in the same day as the current moment next day.
at line520
bool
isLastDay()
Checks if the instance is in the same day as the current moment last day.
at line520
bool
isSameHour(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentHour()
Checks if the instance is in the same hour as the current moment.
at line520
bool
isNextHour()
Checks if the instance is in the same hour as the current moment next hour.
at line520
bool
isLastHour()
Checks if the instance is in the same hour as the current moment last hour.
at line520
bool
isSameMinute(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentMinute()
Checks if the instance is in the same minute as the current moment.
at line520
bool
isNextMinute()
Checks if the instance is in the same minute as the current moment next minute.
at line520
bool
isLastMinute()
Checks if the instance is in the same minute as the current moment last minute.
at line520
bool
isSameSecond(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentSecond()
Checks if the instance is in the same second as the current moment.
at line520
bool
isNextSecond()
Checks if the instance is in the same second as the current moment next second.
at line520
bool
isLastSecond()
Checks if the instance is in the same second as the current moment last second.
at line520
bool
isSameMicro(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentMicro()
Checks if the instance is in the same microsecond as the current moment.
at line520
bool
isNextMicro()
Checks if the instance is in the same microsecond as the current moment next microsecond.
at line520
bool
isLastMicro()
Checks if the instance is in the same microsecond as the current moment last microsecond.
at line520
bool
isSameMicrosecond(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentMicrosecond()
Checks if the instance is in the same microsecond as the current moment.
at line520
bool
isNextMicrosecond()
Checks if the instance is in the same microsecond as the current moment next microsecond.
at line520
bool
isLastMicrosecond()
Checks if the instance is in the same microsecond as the current moment last microsecond.
at line520
bool
isCurrentMonth()
Checks if the instance is in the same month as the current moment.
at line520
bool
isNextMonth()
Checks if the instance is in the same month as the current moment next month.
at line520
bool
isLastMonth()
Checks if the instance is in the same month as the current moment last month.
at line520
bool
isCurrentQuarter()
Checks if the instance is in the same quarter as the current moment.
at line520
bool
isNextQuarter()
Checks if the instance is in the same quarter as the current moment next quarter.
at line520
bool
isLastQuarter()
Checks if the instance is in the same quarter as the current moment last quarter.
at line520
bool
isSameDecade(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentDecade()
Checks if the instance is in the same decade as the current moment.
at line520
bool
isNextDecade()
Checks if the instance is in the same decade as the current moment next decade.
at line520
bool
isLastDecade()
Checks if the instance is in the same decade as the current moment last decade.
at line520
bool
isSameCentury(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentCentury()
Checks if the instance is in the same century as the current moment.
at line520
bool
isNextCentury()
Checks if the instance is in the same century as the current moment next century.
at line520
bool
isLastCentury()
Checks if the instance is in the same century as the current moment last century.
at line520
bool
isSameMillennium(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
at line520
bool
isCurrentMillennium()
Checks if the instance is in the same millennium as the current moment.
at line520
bool
isNextMillennium()
Checks if the instance is in the same millennium as the current moment next millennium.
at line520
bool
isLastMillennium()
Checks if the instance is in the same millennium as the current moment last millennium.
at line520
CarbonInterface
years(int $value)
Set current instance year to the given value.
at line520
CarbonInterface
year(int $value)
Set current instance year to the given value.
at line520
CarbonInterface
setYears(int $value)
Set current instance year to the given value.
at line520
CarbonInterface
setYear(int $value)
Set current instance year to the given value.
at line520
CarbonInterface
months(int $value)
Set current instance month to the given value.
at line520
CarbonInterface
month(int $value)
Set current instance month to the given value.
at line520
CarbonInterface
setMonths(int $value)
Set current instance month to the given value.
at line520
CarbonInterface
setMonth(int $value)
Set current instance month to the given value.
at line520
CarbonInterface
days(int $value)
Set current instance day to the given value.
at line520
CarbonInterface
day(int $value)
Set current instance day to the given value.
at line520
CarbonInterface
setDays(int $value)
Set current instance day to the given value.
at line520
CarbonInterface
setDay(int $value)
Set current instance day to the given value.
at line520
CarbonInterface
hours(int $value)
Set current instance hour to the given value.
at line520
CarbonInterface
hour(int $value)
Set current instance hour to the given value.
at line520
CarbonInterface
setHours(int $value)
Set current instance hour to the given value.
at line520
CarbonInterface
setHour(int $value)
Set current instance hour to the given value.
at line520
CarbonInterface
minutes(int $value)
Set current instance minute to the given value.
at line520
CarbonInterface
minute(int $value)
Set current instance minute to the given value.
at line520
CarbonInterface
setMinutes(int $value)
Set current instance minute to the given value.
at line520
CarbonInterface
setMinute(int $value)
Set current instance minute to the given value.
at line520
CarbonInterface
seconds(int $value)
Set current instance second to the given value.
at line520
CarbonInterface
second(int $value)
Set current instance second to the given value.
at line520
CarbonInterface
setSeconds(int $value)
Set current instance second to the given value.
at line520
CarbonInterface
setSecond(int $value)
Set current instance second to the given value.
at line520
CarbonInterface
millis(int $value)
Set current instance millisecond to the given value.
at line520
CarbonInterface
milli(int $value)
Set current instance millisecond to the given value.
at line520
CarbonInterface
setMillis(int $value)
Set current instance millisecond to the given value.
at line520
CarbonInterface
setMilli(int $value)
Set current instance millisecond to the given value.
at line520
CarbonInterface
milliseconds(int $value)
Set current instance millisecond to the given value.
at line520
CarbonInterface
millisecond(int $value)
Set current instance millisecond to the given value.
at line520
CarbonInterface
setMilliseconds(int $value)
Set current instance millisecond to the given value.
at line520
CarbonInterface
setMillisecond(int $value)
Set current instance millisecond to the given value.
at line520
CarbonInterface
micros(int $value)
Set current instance microsecond to the given value.
at line520
CarbonInterface
micro(int $value)
Set current instance microsecond to the given value.
at line520
CarbonInterface
setMicros(int $value)
Set current instance microsecond to the given value.
at line520
CarbonInterface
setMicro(int $value)
Set current instance microsecond to the given value.
at line520
CarbonInterface
microseconds(int $value)
Set current instance microsecond to the given value.
at line520
CarbonInterface
microsecond(int $value)
Set current instance microsecond to the given value.
at line520
CarbonInterface
setMicroseconds(int $value)
Set current instance microsecond to the given value.
at line520
CarbonInterface
setMicrosecond(int $value)
Set current instance microsecond to the given value.
at line520
CarbonInterface
addYears(int $value =1)
Add years (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addYear()
Add one year to the instance (using date interval).
at line520
CarbonInterface
subYears(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subYear()
Sub one year to the instance (using date interval).
at line520
CarbonInterface
addYearsWithOverflow(int $value =1)
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addYearWithOverflow()
Add one year to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subYearsWithOverflow(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subYearWithOverflow()
Sub one year to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addYearsWithoutOverflow(int $value =1)
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addYearWithoutOverflow()
Add one year to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subYearsWithoutOverflow(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subYearWithoutOverflow()
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addYearsWithNoOverflow(int $value =1)
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addYearWithNoOverflow()
Add one year to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subYearsWithNoOverflow(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subYearWithNoOverflow()
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addYearsNoOverflow(int $value =1)
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addYearNoOverflow()
Add one year to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subYearsNoOverflow(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subYearNoOverflow()
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMonths(int $value =1)
Add months (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addMonth()
Add one month to the instance (using date interval).
at line520
CarbonInterface
subMonths(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subMonth()
Sub one month to the instance (using date interval).
at line520
CarbonInterface
addMonthsWithOverflow(int $value =1)
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addMonthWithOverflow()
Add one month to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subMonthsWithOverflow(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subMonthWithOverflow()
Sub one month to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addMonthsWithoutOverflow(int $value =1)
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMonthWithoutOverflow()
Add one month to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMonthsWithoutOverflow(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMonthWithoutOverflow()
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMonthsWithNoOverflow(int $value =1)
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMonthWithNoOverflow()
Add one month to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMonthsWithNoOverflow(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMonthWithNoOverflow()
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMonthsNoOverflow(int $value =1)
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMonthNoOverflow()
Add one month to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMonthsNoOverflow(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMonthNoOverflow()
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addDays(int $value =1)
Add days (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addDay()
Add one day to the instance (using date interval).
at line520
CarbonInterface
subDays(int $value =1)
Sub days (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subDay()
Sub one day to the instance (using date interval).
at line520
CarbonInterface
addHours(int $value =1)
Add hours (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addHour()
Add one hour to the instance (using date interval).
at line520
CarbonInterface
subHours(int $value =1)
Sub hours (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subHour()
Sub one hour to the instance (using date interval).
at line520
CarbonInterface
addMinutes(int $value =1)
Add minutes (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addMinute()
Add one minute to the instance (using date interval).
at line520
CarbonInterface
subMinutes(int $value =1)
Sub minutes (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subMinute()
Sub one minute to the instance (using date interval).
at line520
CarbonInterface
addSeconds(int $value =1)
Add seconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addSecond()
Add one second to the instance (using date interval).
at line520
CarbonInterface
subSeconds(int $value =1)
Sub seconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subSecond()
Sub one second to the instance (using date interval).
at line520
CarbonInterface
addMillis(int $value =1)
Add milliseconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addMilli()
Add one millisecond to the instance (using date interval).
at line520
CarbonInterface
subMillis(int $value =1)
Sub milliseconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subMilli()
Sub one millisecond to the instance (using date interval).
at line520
CarbonInterface
addMilliseconds(int $value =1)
Add milliseconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addMillisecond()
Add one millisecond to the instance (using date interval).
at line520
CarbonInterface
subMilliseconds(int $value =1)
Sub milliseconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subMillisecond()
Sub one millisecond to the instance (using date interval).
at line520
CarbonInterface
addMicros(int $value =1)
Add microseconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addMicro()
Add one microsecond to the instance (using date interval).
at line520
CarbonInterface
subMicros(int $value =1)
Sub microseconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subMicro()
Sub one microsecond to the instance (using date interval).
at line520
CarbonInterface
addMicroseconds(int $value =1)
Add microseconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addMicrosecond()
Add one microsecond to the instance (using date interval).
at line520
CarbonInterface
subMicroseconds(int $value =1)
Sub microseconds (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subMicrosecond()
Sub one microsecond to the instance (using date interval).
at line520
CarbonInterface
addMillennia(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addMillennium()
Add one millennium to the instance (using date interval).
at line520
CarbonInterface
subMillennia(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subMillennium()
Sub one millennium to the instance (using date interval).
at line520
CarbonInterface
addMillenniaWithOverflow(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addMillenniumWithOverflow()
Add one millennium to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subMillenniaWithOverflow(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subMillenniumWithOverflow()
Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addMillenniaWithoutOverflow(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMillenniumWithoutOverflow()
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMillenniaWithoutOverflow(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMillenniumWithoutOverflow()
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMillenniaWithNoOverflow(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMillenniumWithNoOverflow()
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMillenniaWithNoOverflow(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMillenniumWithNoOverflow()
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMillenniaNoOverflow(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addMillenniumNoOverflow()
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMillenniaNoOverflow(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subMillenniumNoOverflow()
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addCenturies(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addCentury()
Add one century to the instance (using date interval).
at line520
CarbonInterface
subCenturies(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subCentury()
Sub one century to the instance (using date interval).
at line520
CarbonInterface
addCenturiesWithOverflow(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addCenturyWithOverflow()
Add one century to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subCenturiesWithOverflow(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subCenturyWithOverflow()
Sub one century to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addCenturiesWithoutOverflow(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addCenturyWithoutOverflow()
Add one century to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subCenturiesWithoutOverflow(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subCenturyWithoutOverflow()
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addCenturiesWithNoOverflow(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addCenturyWithNoOverflow()
Add one century to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subCenturiesWithNoOverflow(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subCenturyWithNoOverflow()
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addCenturiesNoOverflow(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addCenturyNoOverflow()
Add one century to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subCenturiesNoOverflow(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subCenturyNoOverflow()
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addDecades(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addDecade()
Add one decade to the instance (using date interval).
at line520
CarbonInterface
subDecades(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subDecade()
Sub one decade to the instance (using date interval).
at line520
CarbonInterface
addDecadesWithOverflow(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addDecadeWithOverflow()
Add one decade to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subDecadesWithOverflow(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subDecadeWithOverflow()
Sub one decade to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addDecadesWithoutOverflow(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addDecadeWithoutOverflow()
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subDecadesWithoutOverflow(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subDecadeWithoutOverflow()
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addDecadesWithNoOverflow(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addDecadeWithNoOverflow()
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subDecadesWithNoOverflow(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subDecadeWithNoOverflow()
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addDecadesNoOverflow(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addDecadeNoOverflow()
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subDecadesNoOverflow(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subDecadeNoOverflow()
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addQuarters(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addQuarter()
Add one quarter to the instance (using date interval).
at line520
CarbonInterface
subQuarters(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subQuarter()
Sub one quarter to the instance (using date interval).
at line520
CarbonInterface
addQuartersWithOverflow(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addQuarterWithOverflow()
Add one quarter to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subQuartersWithOverflow(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
subQuarterWithOverflow()
Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
at line520
CarbonInterface
addQuartersWithoutOverflow(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addQuarterWithoutOverflow()
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subQuartersWithoutOverflow(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subQuarterWithoutOverflow()
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addQuartersWithNoOverflow(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addQuarterWithNoOverflow()
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subQuartersWithNoOverflow(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subQuarterWithNoOverflow()
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addQuartersNoOverflow(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addQuarterNoOverflow()
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subQuartersNoOverflow(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
subQuarterNoOverflow()
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
at line520
CarbonInterface
addWeeks(int $value =1)
Add weeks (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addWeek()
Add one week to the instance (using date interval).
at line520
CarbonInterface
subWeeks(int $value =1)
Sub weeks (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subWeek()
Sub one week to the instance (using date interval).
at line520
CarbonInterface
addWeekdays(int $value =1)
Add weekdays (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
addWeekday()
Add one weekday to the instance (using date interval).
at line520
CarbonInterface
subWeekdays(int $value =1)
Sub weekdays (the $value count passed in) to the instance (using date interval).
at line520
CarbonInterface
subWeekday()
Sub one weekday to the instance (using date interval).
at line520
CarbonInterface
addRealMicros(int $value =1)
Add microseconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealMicro()
Add one microsecond to the instance (using timestamp).
at line520
CarbonInterface
subRealMicros(int $value =1)
Sub microseconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealMicro()
Sub one microsecond to the instance (using timestamp).
at line520
CarbonPeriod
microsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
at line520
CarbonInterface
addRealMicroseconds(int $value =1)
Add microseconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealMicrosecond()
Add one microsecond to the instance (using timestamp).
at line520
CarbonInterface
subRealMicroseconds(int $value =1)
Sub microseconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealMicrosecond()
Sub one microsecond to the instance (using timestamp).
at line520
CarbonPeriod
microsecondsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
at line520
CarbonInterface
addRealMillis(int $value =1)
Add milliseconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealMilli()
Add one millisecond to the instance (using timestamp).
at line520
CarbonInterface
subRealMillis(int $value =1)
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealMilli()
Sub one millisecond to the instance (using timestamp).
at line520
CarbonPeriod
millisUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
at line520
CarbonInterface
addRealMilliseconds(int $value =1)
Add milliseconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealMillisecond()
Add one millisecond to the instance (using timestamp).
at line520
CarbonInterface
subRealMilliseconds(int $value =1)
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealMillisecond()
Sub one millisecond to the instance (using timestamp).
at line520
CarbonPeriod
millisecondsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
at line520
CarbonInterface
addRealSeconds(int $value =1)
Add seconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealSecond()
Add one second to the instance (using timestamp).
at line520
CarbonInterface
subRealSeconds(int $value =1)
Sub seconds (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealSecond()
Sub one second to the instance (using timestamp).
at line520
CarbonPeriod
secondsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given.
at line520
CarbonInterface
addRealMinutes(int $value =1)
Add minutes (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealMinute()
Add one minute to the instance (using timestamp).
at line520
CarbonInterface
subRealMinutes(int $value =1)
Sub minutes (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealMinute()
Sub one minute to the instance (using timestamp).
at line520
CarbonPeriod
minutesUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given.
at line520
CarbonInterface
addRealHours(int $value =1)
Add hours (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealHour()
Add one hour to the instance (using timestamp).
at line520
CarbonInterface
subRealHours(int $value =1)
Sub hours (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealHour()
Sub one hour to the instance (using timestamp).
at line520
CarbonPeriod
hoursUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given.
at line520
CarbonInterface
addRealDays(int $value =1)
Add days (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealDay()
Add one day to the instance (using timestamp).
at line520
CarbonInterface
subRealDays(int $value =1)
Sub days (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealDay()
Sub one day to the instance (using timestamp).
at line520
CarbonPeriod
daysUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given.
at line520
CarbonInterface
addRealWeeks(int $value =1)
Add weeks (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealWeek()
Add one week to the instance (using timestamp).
at line520
CarbonInterface
subRealWeeks(int $value =1)
Sub weeks (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealWeek()
Sub one week to the instance (using timestamp).
at line520
CarbonPeriod
weeksUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given.
at line520
CarbonInterface
addRealMonths(int $value =1)
Add months (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealMonth()
Add one month to the instance (using timestamp).
at line520
CarbonInterface
subRealMonths(int $value =1)
Sub months (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealMonth()
Sub one month to the instance (using timestamp).
at line520
CarbonPeriod
monthsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given.
at line520
CarbonInterface
addRealQuarters(int $value =1)
Add quarters (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealQuarter()
Add one quarter to the instance (using timestamp).
at line520
CarbonInterface
subRealQuarters(int $value =1)
Sub quarters (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealQuarter()
Sub one quarter to the instance (using timestamp).
at line520
CarbonPeriod
quartersUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given.
at line520
CarbonInterface
addRealYears(int $value =1)
Add years (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealYear()
Add one year to the instance (using timestamp).
at line520
CarbonInterface
subRealYears(int $value =1)
Sub years (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealYear()
Sub one year to the instance (using timestamp).
at line520
CarbonPeriod
yearsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given.
at line520
CarbonInterface
addRealDecades(int $value =1)
Add decades (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealDecade()
Add one decade to the instance (using timestamp).
at line520
CarbonInterface
subRealDecades(int $value =1)
Sub decades (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealDecade()
Sub one decade to the instance (using timestamp).
at line520
CarbonPeriod
decadesUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given.
at line520
CarbonInterface
addRealCenturies(int $value =1)
Add centuries (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealCentury()
Add one century to the instance (using timestamp).
at line520
CarbonInterface
subRealCenturies(int $value =1)
Sub centuries (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealCentury()
Sub one century to the instance (using timestamp).
at line520
CarbonPeriod
centuriesUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given.
at line520
CarbonInterface
addRealMillennia(int $value =1)
Add millennia (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
addRealMillennium()
Add one millennium to the instance (using timestamp).
at line520
CarbonInterface
subRealMillennia(int $value =1)
Sub millennia (the $value count passed in) to the instance (using timestamp).
at line520
CarbonInterface
subRealMillennium()
Sub one millennium to the instance (using timestamp).
at line520
CarbonPeriod
millenniaUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given.
at line520
CarbonInterface
roundYear(float $precision =1,string $function ="round")
Round the current instance year with given precision using the given function.
at line520
CarbonInterface
roundYears(float $precision =1,string $function ="round")
Round the current instance year with given precision using the given function.
at line520
CarbonInterface
floorYear(float $precision =1)
Truncate the current instance year with given precision.
at line520
CarbonInterface
floorYears(float $precision =1)
Truncate the current instance year with given precision.
at line520
CarbonInterface
ceilYear(float $precision =1)
Ceil the current instance year with given precision.
at line520
CarbonInterface
ceilYears(float $precision =1)
Ceil the current instance year with given precision.
at line520
CarbonInterface
roundMonth(float $precision =1,string $function ="round")
Round the current instance month with given precision using the given function.
at line520
CarbonInterface
roundMonths(float $precision =1,string $function ="round")
Round the current instance month with given precision using the given function.
at line520
CarbonInterface
floorMonth(float $precision =1)
Truncate the current instance month with given precision.
at line520
CarbonInterface
floorMonths(float $precision =1)
Truncate the current instance month with given precision.
at line520
CarbonInterface
ceilMonth(float $precision =1)
Ceil the current instance month with given precision.
at line520
CarbonInterface
ceilMonths(float $precision =1)
Ceil the current instance month with given precision.
at line520
CarbonInterface
roundDay(float $precision =1,string $function ="round")
Round the current instance day with given precision using the given function.
at line520
CarbonInterface
roundDays(float $precision =1,string $function ="round")
Round the current instance day with given precision using the given function.
at line520
CarbonInterface
floorDay(float $precision =1)
Truncate the current instance day with given precision.
at line520
CarbonInterface
floorDays(float $precision =1)
Truncate the current instance day with given precision.
at line520
CarbonInterface
ceilDay(float $precision =1)
Ceil the current instance day with given precision.
at line520
CarbonInterface
ceilDays(float $precision =1)
Ceil the current instance day with given precision.
at line520
CarbonInterface
roundHour(float $precision =1,string $function ="round")
Round the current instance hour with given precision using the given function.
at line520
CarbonInterface
roundHours(float $precision =1,string $function ="round")
Round the current instance hour with given precision using the given function.
at line520
CarbonInterface
floorHour(float $precision =1)
Truncate the current instance hour with given precision.
at line520
CarbonInterface
floorHours(float $precision =1)
Truncate the current instance hour with given precision.
at line520
CarbonInterface
ceilHour(float $precision =1)
Ceil the current instance hour with given precision.
at line520
CarbonInterface
ceilHours(float $precision =1)
Ceil the current instance hour with given precision.
at line520
CarbonInterface
roundMinute(float $precision =1,string $function ="round")
Round the current instance minute with given precision using the given function.
at line520
CarbonInterface
roundMinutes(float $precision =1,string $function ="round")
Round the current instance minute with given precision using the given function.
at line520
CarbonInterface
floorMinute(float $precision =1)
Truncate the current instance minute with given precision.
at line520
CarbonInterface
floorMinutes(float $precision =1)
Truncate the current instance minute with given precision.
at line520
CarbonInterface
ceilMinute(float $precision =1)
Ceil the current instance minute with given precision.
at line520
CarbonInterface
ceilMinutes(float $precision =1)
Ceil the current instance minute with given precision.
at line520
CarbonInterface
roundSecond(float $precision =1,string $function ="round")
Round the current instance second with given precision using the given function.
at line520
CarbonInterface
roundSeconds(float $precision =1,string $function ="round")
Round the current instance second with given precision using the given function.
at line520
CarbonInterface
floorSecond(float $precision =1)
Truncate the current instance second with given precision.
at line520
CarbonInterface
floorSeconds(float $precision =1)
Truncate the current instance second with given precision.
at line520
CarbonInterface
ceilSecond(float $precision =1)
Ceil the current instance second with given precision.
at line520
CarbonInterface
ceilSeconds(float $precision =1)
Ceil the current instance second with given precision.
at line520
CarbonInterface
roundMillennium(float $precision =1,string $function ="round")
Round the current instance millennium with given precision using the given function.
at line520
CarbonInterface
roundMillennia(float $precision =1,string $function ="round")
Round the current instance millennium with given precision using the given function.
at line520
CarbonInterface
floorMillennium(float $precision =1)
Truncate the current instance millennium with given precision.
at line520
CarbonInterface
floorMillennia(float $precision =1)
Truncate the current instance millennium with given precision.
at line520
CarbonInterface
ceilMillennium(float $precision =1)
Ceil the current instance millennium with given precision.
at line520
CarbonInterface
ceilMillennia(float $precision =1)
Ceil the current instance millennium with given precision.
at line520
CarbonInterface
roundCentury(float $precision =1,string $function ="round")
Round the current instance century with given precision using the given function.
at line520
CarbonInterface
roundCenturies(float $precision =1,string $function ="round")
Round the current instance century with given precision using the given function.
at line520
CarbonInterface
floorCentury(float $precision =1)
Truncate the current instance century with given precision.
at line520
CarbonInterface
floorCenturies(float $precision =1)
Truncate the current instance century with given precision.
at line520
CarbonInterface
ceilCentury(float $precision =1)
Ceil the current instance century with given precision.
at line520
CarbonInterface
ceilCenturies(float $precision =1)
Ceil the current instance century with given precision.
at line520
CarbonInterface
roundDecade(float $precision =1,string $function ="round")
Round the current instance decade with given precision using the given function.
at line520
CarbonInterface
roundDecades(float $precision =1,string $function ="round")
Round the current instance decade with given precision using the given function.
at line520
CarbonInterface
floorDecade(float $precision =1)
Truncate the current instance decade with given precision.
at line520
CarbonInterface
floorDecades(float $precision =1)
Truncate the current instance decade with given precision.
at line520
CarbonInterface
ceilDecade(float $precision =1)
Ceil the current instance decade with given precision.
at line520
CarbonInterface
ceilDecades(float $precision =1)
Ceil the current instance decade with given precision.
at line520
CarbonInterface
roundQuarter(float $precision =1,string $function ="round")
Round the current instance quarter with given precision using the given function.
at line520
CarbonInterface
roundQuarters(float $precision =1,string $function ="round")
Round the current instance quarter with given precision using the given function.
at line520
CarbonInterface
floorQuarter(float $precision =1)
Truncate the current instance quarter with given precision.
at line520
CarbonInterface
floorQuarters(float $precision =1)
Truncate the current instance quarter with given precision.
at line520
CarbonInterface
ceilQuarter(float $precision =1)
Ceil the current instance quarter with given precision.
at line520
CarbonInterface
ceilQuarters(float $precision =1)
Ceil the current instance quarter with given precision.
at line520
CarbonInterface
roundMillisecond(float $precision =1,string $function ="round")
Round the current instance millisecond with given precision using the given function.
at line520
CarbonInterface
roundMilliseconds(float $precision =1,string $function ="round")
Round the current instance millisecond with given precision using the given function.
at line520
CarbonInterface
floorMillisecond(float $precision =1)
Truncate the current instance millisecond with given precision.
at line520
CarbonInterface
floorMilliseconds(float $precision =1)
Truncate the current instance millisecond with given precision.
at line520
CarbonInterface
ceilMillisecond(float $precision =1)
Ceil the current instance millisecond with given precision.
at line520
CarbonInterface
ceilMilliseconds(float $precision =1)
Ceil the current instance millisecond with given precision.
at line520
CarbonInterface
roundMicrosecond(float $precision =1,string $function ="round")
Round the current instance microsecond with given precision using the given function.
at line520
CarbonInterface
roundMicroseconds(float $precision =1,string $function ="round")
Round the current instance microsecond with given precision using the given function.
at line520
CarbonInterface
floorMicrosecond(float $precision =1)
Truncate the current instance microsecond with given precision.
at line520
CarbonInterface
floorMicroseconds(float $precision =1)
Truncate the current instance microsecond with given precision.
at line520
CarbonInterface
ceilMicrosecond(float $precision =1)
Ceil the current instance microsecond with given precision.
at line520
CarbonInterface
ceilMicroseconds(float $precision =1)
Ceil the current instance microsecond with given precision.
at line520
string
shortAbsoluteDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line520
string
longAbsoluteDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line520
string
shortRelativeDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line520
string
longRelativeDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line520
string
shortRelativeToNowDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line520
string
longRelativeToNowDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line520
string
shortRelativeToOtherDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line520
string
longRelativeToOtherDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)