class Carbon extendsDateTime implementsCarbonInterface
A simple API extension for DateTime.
Traits
Properties
int | $year | ||
int | $month | ||
int | $daysInMonth | from Serialization | |
int | $quarter | Depends on the following methods: | from Serialization |
protectedbool | $endOfTime | from Comparison | |
protectedbool | $startOfTime | from Comparison | |
staticprotectedstring|Closure|null | $toStringFormat | Format to use for __toString method when type juggling occurs. | from Converter |
protectedstring | $constructedObjectId | True when parent::__construct has been called. | from ObjectInitialisation |
staticprotectedarray | $lastErrors | The errors that can occur. | from Creator |
staticprotectedarray | $macroContextStack | Stack of macro instance contexts. | from Mixin |
staticprotectedarray | $globalMacros | The registered macros. | from Macro |
staticprotectedarray | $globalGenericMacros | The registered generic macros. | from Macro |
staticprotectedint | $midDayAt | Midday/noon hour. | from Modifiers |
staticprotectedTranslatorInterface | $translator | Default translator. | from Localization |
protectedTranslatorInterface | $localTranslator | Specific translator of the current instance. | from Localization |
staticprotectedint | $humanDiffOptions | Options for diffForHumans(). | from Localization |
staticint | $PHPIntSize | Customizable PHP_INT_SIZE override. | from Options |
staticprotectedint|string | $weekStartsAt | First day of week. | from Options |
staticprotectedint|string | $weekEndsAt | Last day of week. | from Options |
staticprotectedarray | $weekendDays | Days of weekend. | from Options |
staticprotectedarray |
$regexFormats | Format regex patterns. | from Options |
staticprotectedarray | $regexFormatModifiers | Format modifiers (such as available in createFromFormat) regex patterns. | from Options |
staticprotectedbool | $monthsOverflow | Indicates if months should be calculated with overflow. | from Options |
staticprotectedbool | $yearsOverflow | Indicates if years should be calculated with overflow. | from Options |
staticprotectedbool | $strictModeEnabled | Indicates if the strict mode is in use. | from Options |
staticprotectedstring|callable|null | $formatFunction | Function to call instead of format. | from Options |
staticprotectedstring|callable|null | $createFromFormatFunction | Function to call instead of createFromFormat. | from Options |
staticprotectedstring|callable|null | $parseFunction | Function to call instead of parse. | from Options |
protectedbool|null | $localMonthsOverflow | Indicates if months should be calculated with overflow. | from Options |
protectedbool|null | $localYearsOverflow | Indicates if years should be calculated with overflow. | from Options |
protectedbool|null | $localStrictModeEnabled | Indicates if the strict mode is in use. | from Options |
protectedbool|null | $localHumanDiffOptions | Options for diffForHumans and forHumans methods. | from Options |
protectedstring|null | $localToStringFormat | Format to use on string cast. | from Options |
protectedstring|null | $localSerializer | Format to use on JSON serialization. | from Options |
protectedarray|null | $localMacros | Instance-specific macros. | from Options |
protectedarray|null | $localGenericMacros | Instance-specific generic macros. | from Options |
protectedstring|callable|null | $localFormatFunction | Function to call instead of format. | from Options |
staticprotectedcallable|null | $serializer | The custom Carbon JSON serializer. | from Serialization |
protectedstring[] | $dumpProperties | List of key to use for dump/serialization. | from Serialization |
protectedstring|null | $dumpLocale | Locale to dump comes here before serialization. | from Serialization |
protectedarray|null | $dumpDateProperties | Embed date properties to dump in a dedicated variables so it won't overlap native DateTime ones. | from Serialization |
staticprotectedClosure|Test|null | $testNow | A test Carbon instance to be returned when now instances are created. | from Test |
staticprotectedstring|null | $testDefaultTimezone | The timezone to resto to when clearing the time mock. | from Test |
int | $daysInYear | from Week | |
int | $dayOfWeek | from Week | |
int | $dayOfYear | 1 through 366 | |
staticprotectedarray | $days | Names of days of the week. | from Date |
staticprotectedbool | $utf8 | Will UTF8 encoding be used to print localized date/time ? | from Date |
staticprotectedarray | $units | List of unit and magic methods associated as doc-comments. | from Date |
int | $yearIso | ||
int | $day | ||
int | $hour | ||
int | $minute | ||
int | $second | ||
int | $micro | ||
int | $microsecond | ||
int|float|string | $timestamp | seconds since the Unix Epoch | |
string | $englishDayOfWeek | the day of week in English | |
string | $shortEnglishDayOfWeek | the abbreviated day of week in English | |
string | $englishMonth | the month in English | |
string | $shortEnglishMonth | the abbreviated month in English | |
int | $milliseconds | ||
int | $millisecond | ||
int | $milli | ||
int | $week | 1 through 53 | |
int | $isoWeek | 1 through 53 | |
int | $weekYear | year according to week format | |
int | $isoWeekYear | year according to ISO week format | |
int | $age | does a diffInYears() with default parameters | |
int | $offset | the timezone offset in seconds from UTC | |
int | $offsetMinutes | the timezone offset in minutes from UTC | |
int | $offsetHours | the timezone offset in hours from UTC | |
CarbonTimeZone | $timezone | the current timezone | |
CarbonTimeZone | $tz | alias of $timezone |
Methods
Resets the date to the first day of the month and the time to 00:00:00
Resets the date to end of the month and time to 23:59:59.999999
Resets the date to the first day of the quarter and the time to 00:00:00
Resets the date to end of the quarter and time to 23:59:59.999999
Resets the date to the first day of the year and the time to 00:00:00
Resets the date to end of the year and time to 23:59:59.999999
Resets the date to the first day of the decade and the time to 00:00:00
Resets the date to end of the decade and time to 23:59:59.999999
Resets the date to the first day of the century and the time to 00:00:00
Resets the date to end of the century and time to 23:59:59.999999
Resets the date to the first day of the millennium and the time to 00:00:00
Resets the date to end of the millennium and time to 23:59:59.999999
Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
Modify to start of current hour, minutes and seconds become 0
Modify to end of current second, microseconds become 999999
Modify to start of current given unit.
Determines if the instance is greater (after) than another
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
Determines if the instance is less (before) than another
Determines if the instance is less (before) or equal to another
Determines if the instance is less (before) or equal to another
Determines if the instance is between two others.
Determines if the instance is between two others, bounds included.
Determines if the instance is between two others, bounds excluded.
Determines if the instance is between two others
Determines if the instance is in the future, ie. greater (after) than now.
Determines if the instance is in the past, ie. less (before) than now.
Compares the formatted values of the two dates.
Determines if the instance is in the current unit given.
Determines if the instance is in the current unit given.
Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).
Checks if the passed in date is in the same month as the instance´s month.
Check if its the birthday. Compares the date/month values of the two dates.
Check if the instance is start of day / midnight.
Checks if the (date)time string is in a given format.
Checks if the (date)time string is in a given format.
Checks if the (date)time string is in a given format and valid to create a new instance.
Returns true if the date was created using CarbonImmutable::startOfTime()
Returns true if the date was created using CarbonImmutable::endOfTime()
Reset the format used to the default when type juggling a Carbon instance to a string
Format the instance with the day, and a readable date
Format the instance as date and time
Return a format from H:i to H:i:s.u according to given unit precision.
Format the instance as date and time T-separated with no timezone
Convert the instance to UTC and return as Zulu ISO8601
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 native DateTime PHP object matching the current instance.
Return native toDateTimeImmutable PHP object matching the current instance.
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
Create a new Carbon instance.
Create a carbon instance from a string.
Create a carbon instance from a string.
Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).
Create a new Carbon instance from a specific date and time.
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.
Create a Carbon instance from just a date. The time portion is set to now.
Create a Carbon instance from just a date. The time portion is set to midnight.
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 specific format.
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.
Make a Carbon instance from given variable if possible.
Get the difference as a CarbonInterval instance.
Get the difference in years
Get the difference in quarters rounded down.
Get the difference in months rounded down.
Get the difference in weeks rounded down.
Get the difference in days rounded down.
Get the difference in days using a filter closure rounded down.
Get the difference in hours using a filter closure rounded down.
Get the difference by the given interval using a filter closure.
Get the difference in weekdays rounded down.
Get the difference in weekend days using a filter rounded down.
Get the difference in hours rounded down.
Get the difference in hours rounded down using timestamps.
Get the difference in minutes rounded down.
Get the difference in minutes rounded down using timestamps.
Get the difference in seconds rounded down.
Get the difference in microseconds.
Get the difference in milliseconds rounded down.
Get the difference in seconds using timestamps.
Get the difference in microseconds using timestamps.
Get the difference in milliseconds rounded down using timestamps.
Get the difference in seconds as float (microsecond-precision).
Get the difference in minutes as float (microsecond-precision).
Get the difference in hours as float (microsecond-precision).
Get the difference in days as float (microsecond-precision).
Get the difference in weeks as float (microsecond-precision).
Get the difference in months as float (microsecond-precision).
Get the difference in year as float (microsecond-precision).
Get the difference in seconds as float (microsecond-precision) using timestamps.
Get the difference in minutes as float (microsecond-precision) using timestamps.
Get the difference in hours as float (microsecond-precision) using timestamps.
Get the difference in days as float (microsecond-precision).
Get the difference in weeks as float (microsecond-precision).
Get the difference in months as float (microsecond-precision) using timestamps.
Get the difference in year as float (microsecond-precision) using timestamps.
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).
No description
No description
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.
No description
Get the difference in a human readable format in the current locale from current instance to now.
Get the difference in a human readable format in the current locale from an other instance given to now
Get the difference in a human readable format in the current locale from an other instance given to now
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).
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.
Stack a Carbon context from inside calls of self::this() and execute a given action.
Return the current context from inside a macro callee or a null if static.
Return the current context from inside a macro callee or a new one if static.
Get the raw callable macro registered globally for a given name.
Get the raw callable macro registered globally or locally for a given name.
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.
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 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 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 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 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 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 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.
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.
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.
Modify the current instance to the average of a given instance (default now) and the current instance (second-precision).
Get the closest date from the instance (second-precision).
Get the farthest date from the instance (second-precision).
Get the minimum instance between a given instance (default now) and the current instance.
Get the minimum instance between a given instance (default now) and the current instance.
Get the maximum instance between a given instance (default now) and the current instance.
Get the maximum instance between a given instance (default now) and the current instance.
Similar to native modify() method of DateTime but can handle more grammars.
Returns true if the current class/instance is mutable.
Return default humanDiff() options (merged flags as integer).
Get the default translator instance in use.
Set the default translator instance to use.
Return true if the current instance has its own translator.
Get the translator of the current instance or the default if none set.
Set the translator for the current instance.
Returns raw translation message for a given key.
Returns raw translation message for a given key.
Translate using translation string or callback available.
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.
Get/set the locale for the current instance.
Set the current translator locale and indicate if the source locale file exists.
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).
Returns true if the given locale is internally supported and has short-units support.
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 1-day diff (just now, yesterday, tomorrow).
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 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.
Initialize the default translator instance if necessary.
Get the locale of a given translator.
Throw an error if passed object is not LocaleAwareInterface.
Returns true if the strict mode is globally in use, false else.
Get the month overflow global behavior (can be overridden in specific instances).
Get the month overflow global behavior (can be overridden in specific instances).
Round the current instance at the given unit with given precision if specified and the given function.
Truncate the current instance at the given unit with given precision if specified.
Ceil the current instance at the given unit with given precision if specified.
Round the current instance second with given precision if specified.
Round the current instance second with given precision if specified.
Ceil the current instance second with given precision if specified.
Create an instance from a serialized string.
Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.
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().
Temporarily sets a static date to be used within the callback.
Get the Carbon instance (real or mock) to be returned when a "now" instance is created.
Determine if there is a valid test instance set. A valid test instance is anything that is not null.
Get the mocked date passed in setTestNow() and if it's a Closure, execute it.
Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).
Create a Carbon instance from an timestamp keeping the timezone to UTC.
Create a Carbon instance from a timestamp in milliseconds.
Create a Carbon instance from a timestamp in milliseconds.
Returns a timestamp rounded with the given precision (6 by default).
Returns the milliseconds timestamps used amongst other by Date javascript objects.
Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.
Returns true if a property can be changed via setter.
Add given units to the current instance.
Subtract given units to the current instance.
Subtract given units or interval to the current instance.
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.
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 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.
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).
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).
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.
Creates a DateTimeZone from a string, DateTimeZone or integer offset.
List of minimum and maximums for each unit.
Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface.
Return the Carbon instance passed through, a now instance in UTC if null given or parse the input if string given (using current timezone then switching to UTC).
Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
No description
Get the translation of the current week day name (with context for languages with multiple forms).
Get the translation of the current short week day name (with context for languages with multiple forms).
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 month day name (with context for languages with multiple forms).
Get/set the weekday from 0 (Sunday) to 6 (Saturday).
Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
Set any unit to a new value without overflowing current other unit given.
Add any unit to a new value without overflowing current other unit given.
Subtract any unit to a new value without overflowing current other unit given.
Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
Set the date and time all together.
Set the timezone or returns the timezone name if no arguments passed.
Set the year, month, and date for this instance to that of the passed instance.
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
Set the date and time for this instance to that of the passed instance.
Determine if a time string will produce a relative date.
Format the instance with the current locale. You can set the current locale using setlocale() https://php.net/setlocale.
Returns list of locale formats for ISO formatting.
Returns list of calendar formats for ISO formatting.
Returns a unit of the instance padded with 0 by default or any other string if specified.
Return the meridiem of the current time in the current locale.
Returns the alternative number for a given date property if available in the current locale.
Format in the current language using ISO replacement patterns.
List of replacements from date() format to isoFormat().
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.
Returns the offset hour and minute formatted with +/- and a given separator (":" by default).
Dynamically handle calls to the class.
Returns standardized singular of a given singular/plural unit name (in English).
Returns standardized plural of a given singular/plural unit name (in English).
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 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.
Add years (the $value count passed in) to the instance (using date interval).
Sub years (the $value count passed in) to the instance (using date interval).
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).
Sub months (the $value count passed in) to the instance (using date interval).
Add months (the $value count passed in) to the instance (using date interval) 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).
Sub days (the $value count passed in) to the instance (using date interval).
Add hours (the $value count passed in) to the instance (using date interval).
Sub hours (the $value count passed in) to the instance (using date interval).
Add minutes (the $value count passed in) to the instance (using date interval).
Sub minutes (the $value count passed in) to the instance (using date interval).
Add seconds (the $value count passed in) to the instance (using date interval).
Sub seconds (the $value count passed in) to the instance (using date interval).
Add milliseconds (the $value count passed in) to the instance (using date interval).
Sub milliseconds (the $value count passed in) to the instance (using date interval).
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).
Sub microseconds (the $value count passed in) to the instance (using date interval).
Add microseconds (the $value count passed in) to the instance (using date interval).
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).
Sub millennia (the $value count passed in) to the instance (using date interval).
Add millennia (the $value count passed in) to the instance (using date interval) 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).
Sub centuries (the $value count passed in) to the instance (using date interval).
Add centuries (the $value count passed in) to the instance (using date interval) 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).
Sub decades (the $value count passed in) to the instance (using date interval).
Add decades (the $value count passed in) to the instance (using date interval) 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).
Sub quarters (the $value count passed in) to the instance (using date interval).
Add quarters (the $value count passed in) to the instance (using date interval) 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 weekdays (the $value count passed in) to the instance (using date interval).
Sub weekdays (the $value count passed in) to the instance (using date interval).
Add microseconds (the $value count passed in) to the instance (using timestamp).
Sub microseconds (the $value count passed in) 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).
Sub milliseconds (the $value count passed in) 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).
Sub seconds (the $value count passed in) 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).
Sub minutes (the $value count passed in) 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).
Sub hours (the $value count passed in) 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).
Sub days (the $value count passed in) 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).
Sub weeks (the $value count passed in) 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).
Sub months (the $value count passed in) 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).
Sub quarters (the $value count passed in) 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).
Sub years (the $value count passed in) 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).
Sub decades (the $value count passed in) 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).
Sub centuries (the $value count passed in) 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).
Sub millennia (the $value count passed in) 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
inBoundariesat line46
Boundaries
startOfDay()
Resets the time to 00:00:00 start of day
inBoundariesat line61
Boundaries
endOfDay()
Resets the time to 23:59:59.999999 end of day
inBoundariesat line76
Boundaries
startOfMonth()
Resets the date to the first day of the month and the time to 00:00:00
inBoundariesat line91
Boundaries
endOfMonth()
Resets the date to end of the month and time to 23:59:59.999999
inBoundariesat line106
Boundaries
startOfQuarter()
Resets the date to the first day of the quarter and the time to 00:00:00
inBoundariesat line123
Boundaries
endOfQuarter()
Resets the date to end of the quarter and time to 23:59:59.999999
inBoundariesat line138
Boundaries
startOfYear()
Resets the date to the first day of the year and the time to 00:00:00
inBoundariesat line153
Boundaries
endOfYear()
Resets the date to end of the year and time to 23:59:59.999999
inBoundariesat line168
Boundaries
startOfDecade()
Resets the date to the first day of the decade and the time to 00:00:00
inBoundariesat line185
Boundaries
endOfDecade()
Resets the date to end of the decade and time to 23:59:59.999999
inBoundariesat line202
Boundaries
startOfCentury()
Resets the date to the first day of the century and the time to 00:00:00
inBoundariesat line219
Boundaries
endOfCentury()
Resets the date to end of the century and time to 23:59:59.999999
inBoundariesat line236
Boundaries
startOfMillennium()
Resets the date to the first day of the millennium and the time to 00:00:00
inBoundariesat line253
Boundaries
endOfMillennium()
Resets the date to end of the millennium and time to 23:59:59.999999
inWeekat line37
static
startOfWeek(int $day =1)
inBoundariesat line293
Boundaries
endOfWeek(int$weekEndsAt =null)
Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
inBoundariesat line308
Boundaries
startOfHour()
Modify to start of current hour, minutes and seconds become 0
inBoundariesat line323
Boundaries
endOfHour()
Modify to end of current hour, minutes and seconds become 59
inBoundariesat line338
Boundaries
startOfMinute()
Modify to start of current minute, seconds become 0
inBoundariesat line353
Boundaries
endOfMinute()
Modify to end of current minute, seconds become 59
inBoundariesat line370
Boundaries
startOfSecond()
Modify to start of current second, microseconds become 0
inBoundariesat line387
Boundaries
endOfSecond()
Modify to end of current second, microseconds become 999999
inBoundariesat line407
Boundaries
startOf(string$unit,array...$params)
Modify to start of current given unit.
inBoundariesat line433
Boundaries
endOf(string$unit,array...$params)
Modify to end of current given unit.
inComparisonat line57
bool
eq(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is equal to another
inComparisonat line76
bool
equalTo(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is equal to another
inComparisonat line100
bool
ne(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is not equal to another
inComparisonat line119
bool
notEqualTo(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is not equal to another
inComparisonat line140
bool
gt(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than another
inComparisonat line159
bool
greaterThan(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than another
inComparisonat line183
bool
isAfter(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than another
inComparisonat line204
bool
gte(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than or equal to another
inComparisonat line223
bool
greaterThanOrEqualTo(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is greater (after) than or equal to another
inComparisonat line247
bool
lt(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) than another
inDifferenceat line35
bool
lessThan($date)
inComparisonat line290
bool
isBefore(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) than another
inComparisonat line311
bool
lte(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) or equal to another
inComparisonat line330
bool
lessThanOrEqualTo(Carbon|DateTimeInterface|mixed$date)
Determines if the instance is less (before) or equal to another
inComparisonat line359
bool
between(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2,bool$equal =true)
Determines if the instance is between two others.
The third argument allow you to specify if bounds are included or not (true by default) but for when you including/excluding bounds may produce different results in your application, we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead.
inComparisonat line390
bool
betweenIncluded(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)
Determines if the instance is between two others, bounds included.
inComparisonat line410
bool
betweenExcluded(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)
Determines if the instance is between two others, bounds excluded.
inComparisonat line432
bool
isBetween(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2,bool$equal =true)
Determines if the instance is between two others
inComparisonat line448
bool
isWeekday()
Determines if the instance is a weekday.
inComparisonat line464
bool
isWeekend()
Determines if the instance is a weekend day.
inComparisonat line480
bool
isYesterday()
Determines if the instance is yesterday.
inComparisonat line496
bool
isToday()
Determines if the instance is today.
inComparisonat line512
bool
isTomorrow()
Determines if the instance is tomorrow.
inComparisonat line528
bool
isFuture()
Determines if the instance is in the future, ie. greater (after) than now.
inComparisonat line544
bool
isPast()
Determines if the instance is in the past, ie. less (before) than now.
inComparisonat line560
bool
isLeapYear()
Determines if the instance is a leap year.
inComparisonat line578
bool
isLongYear()
Determines if the instance is a long year
inComparisonat line597
bool
isSameAs(string$format,Carbon|DateTimeInterface|string|null$date =null)
Compares the formatted values of the two dates.
inComparisonat line618
bool
isSameUnit(string$unit,Carbon|DateTimeInterface|null$date =null)
Determines if the instance is in the current unit given.
inComparisonat line669
bool
isCurrentUnit(string$unit)
Determines if the instance is in the current unit given.
inComparisonat line690
bool
isSameQuarter(Carbon|DateTimeInterface|string|null$date =null,bool$ofSameYear =true)
Checks if the passed in date is in the same quarter as the instance quarter (and year if needed).
inComparisonat line713
bool
isSameMonth(Carbon|DateTimeInterface|null$date =null,bool$ofSameYear =true)
Checks if the passed in date is in the same month as the instance´s month.
inComparisonat line733
bool
isDayOfWeek(int$dayOfWeek)
Checks if this day is a specific day of the week.
inComparisonat line757
bool
isBirthday(Carbon|DateTimeInterface|null$date =null)
Check if its the birthday. Compares the date/month values of the two dates.
inComparisonat line776
bool
isLastOfMonth()
Check if today is the last day of the Month
inComparisonat line797
bool
isStartOfDay(bool$checkMicroseconds =false)
Check if the instance is start of day / midnight.
inComparisonat line823
bool
isEndOfDay(bool$checkMicroseconds =false)
Check if the instance is end of day.
inComparisonat line843
bool
isMidnight()
Check if the instance is start of day / midnight.
inComparisonat line861
bool
isMidday()
Check if the instance is midday.
inComparisonat line881
staticbool
hasFormat(string$date,string$format)
Checks if the (date)time string is in a given format.
inComparisonat line904
staticbool
hasFormatWithModifiers(string$date,string$format)
Checks if the (date)time string is in a given format.
inComparisonat line924
staticbool
canBeCreatedFromFormat(string$date,string$format)
Checks if the (date)time string is in a given format and valid to create a new instance.
inComparisonat line963
bool
is(string$tester)
Returns true if the current date matches the given string.
inComparisonat line1071
bool
isStartOfTime()
Returns true if the date was created using CarbonImmutable::startOfTime()
inComparisonat line1081
bool
isEndOfTime()
Returns true if the date was created using CarbonImmutable::endOfTime()
inDifferenceat line35
static
resolveCarbon($date =null)
inWeekat line37
static
copy()
inComparisonat line33
static
nowWithSameTz()
inConverterat line49
staticvoid
resetToStringFormat()
Reset the format used to the default when type juggling a Carbon instance to a string
inConverterat line66
staticvoid
setToStringFormat(string|Closure|null$format)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and use other method or custom format passed to format() method if you need to dump an other string format. Set the default format used when type juggling a Carbon instance to a string
inConverterat line81
format($format)
inConverterat line103
string
rawFormat(string$format)
inConverterat line118
string
__toString()
Format the instance as a string using the set format
inConverterat line141
string
toDateString()
Format the instance as date
inConverterat line156
string
toFormattedDateString()
Format the instance as a readable date
inConverterat line171
string
toFormattedDayDateString()
Format the instance with the day, and a readable date
inConverterat line188
string
toTimeString(string$unitPrecision ='second')
Format the instance as time
inConverterat line205
string
toDateTimeString(string$unitPrecision ='second')
Format the instance as date and time
inConverterat line217
staticstring
getTimeFormatByPrecision(string$unitPrecision)
Return a format from H:i to H:i:s.u according to given unit precision.
inConverterat line249
string
toDateTimeLocalString(string$unitPrecision ='second')
Format the instance as date and time T-separated with no timezone
inConverterat line264
string
toDayDateTimeString()
Format the instance with day, date and time
inConverterat line279
string
toAtomString()
Format the instance as ATOM
inConverterat line294
string
toCookieString()
Format the instance as COOKIE
inConverterat line309
string
toIso8601String()
Format the instance as ISO8601
inConverterat line324
string
toRfc822String()
Format the instance as RFC822
inConverterat line341
string
toIso8601ZuluString(string$unitPrecision ='second')
Convert the instance to UTC and return as Zulu ISO8601
inConverterat line358
string
toRfc850String()
Format the instance as RFC850
inConverterat line373
string
toRfc1036String()
Format the instance as RFC1036
inConverterat line388
string
toRfc1123String()
Format the instance as RFC1123
inConverterat line403
string
toRfc2822String()
Format the instance as RFC2822
inConverterat line421
string
toRfc3339String(bool$extended =false)
Format the instance as RFC3339
inConverterat line441
string
toRssString()
Format the instance as RSS
inConverterat line456
string
toW3cString()
Format the instance as W3C
inConverterat line471
string
toRfc7231String()
Format the instance as RFC7231
inConverterat line488
array
toArray()
Get default array representation.
inConverterat line516
object
toObject()
Get default object representation.
inConverterat line531
string
toString()
Returns english human readable complete date string.
inConverterat line550
null|string
toISOString(bool$keepOffset =false)
Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: 1977-04-22T01:00:00-05:00).
inSerializationat line35
string
toJSON()
inConverterat line588
DateTime
toDateTime()
Return native DateTime PHP object matching the current instance.
inConverterat line603
DateTimeImmutable
toDateTimeImmutable()
Return native toDateTimeImmutable PHP object matching the current instance.
inConverterat line634
CarbonPeriod
toPeriod(DateTimeInterface|Carbon|CarbonImmutable|int|null$end =null,int|DateInterval|string|null$interval =null,string|null$unit =null)
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
inConverterat line664
CarbonPeriod
range(DateTimeInterface|Carbon|CarbonImmutable|null$end =null,int|DateInterval|string|null$interval =null,string|null$unit =null)
Create a iterable CarbonPeriod object from current date to a given end date (and optional interval).
inCreatorat line58
__construct(DateTimeInterface|string|null$time =null,DateTimeZone|string|null$tz =null)
Create a new Carbon instance.
Please see the testing aids section (specifically static::setTestNow()) for more on the possibility of this constructor returning a test instance.
inCreatorat line129
__clone()
Update constructedObjectId on cloned.
inCreatorat line141
staticCreator
instance(DateTimeInterface$date)
Create a Carbon instance from a DateTime one.
inCreatorat line178
staticCreator
rawParse(string|DateTimeInterface|null$time =null,DateTimeZone|string|null$tz =null)
Create a carbon instance from a string.
This is an alias for the constructor that allows better fluent syntax as it allows you to do Carbon::parse('Monday next week')->fn() rather than (new Carbon('Monday next week'))->fn().
inCreatorat line211
staticCreator
parse(string|DateTimeInterface|null$time =null,DateTimeZone|string|null$tz =null)
Create a carbon instance from a string.
This is an alias for the constructor that allows better fluent syntax as it allows you to do Carbon::parse('Monday next week')->fn() rather than (new Carbon('Monday next week'))->fn().
inCreatorat line238
staticCreator
parseFromLocale(string$time,string|null$locale =null,DateTimeZone|string|null$tz =null)
Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.).
inCreatorat line250
staticCreator
now(DateTimeZone|string|null$tz =null)
Get a Carbon instance for the current date and time.
inCreatorat line262
staticCreator
today(DateTimeZone|string|null$tz =null)
Create a Carbon instance for today.
inCreatorat line274
staticCreator
tomorrow(DateTimeZone|string|null$tz =null)
Create a Carbon instance for tomorrow.
inCreatorat line286
staticCreator
yesterday(DateTimeZone|string|null$tz =null)
Create a Carbon instance for yesterday.
inCreatorat line296
staticCreator
maxValue()
Create a Carbon instance for the greatest supported date.
inCreatorat line312
staticCreator
minValue()
Create a Carbon instance for the lowest supported date.
inCreatorat line369
staticCreator|false
create(int|null$year =0,int|null$month =1,int|null$day =1,int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)
Create a new Carbon instance from a specific date and time.
If any of $year, $month or $day are set to null their now() values will be used.
If $hour is null it will be set to its now() value and the default values for $minute and $second will be their now() values.
If $hour is not null then the default values for $minute and $second will be 0.
inCreatorat line453
staticCreator|false
createSafe(int|null$year =null,int|null$month =null,int|null$day =null,int|null$hour =null,int|null$minute =null,int|null$second =null,DateTimeZone|string|null$tz =null)
Create a new safe Carbon instance from a specific date and time.
If any of $year, $month or $day are set to null their now() values will be used.
If $hour is null it will be set to its now() value and the default values for $minute and $second will be their now() values.
If $hour is not null then the default values for $minute and $second will be 0.
If one of the set values is not valid, an InvalidDateException will be thrown.
inCreatorat line499
staticCreator
createStrict(int|null$year =0,int|null$month =1,int|null$day =1,int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)
Create a new Carbon instance from a specific date and time using strict validation.
inCreatorat line525
staticCreator
createFromDate(int|null$year =null,int|null$month =null,int|null$day =null,DateTimeZone|string|null$tz =null)
Create a Carbon instance from just a date. The time portion is set to now.
inCreatorat line542
staticCreator
createMidnightDate(int|null$year =null,int|null$month =null,int|null$day =null,DateTimeZone|string|null$tz =null)
Create a Carbon instance from just a date. The time portion is set to midnight.
inCreatorat line559
staticCreator
createFromTime(int|null$hour =0,int|null$minute =0,int|null$second =0,DateTimeZone|string|null$tz =null)
Create a Carbon instance from just a time. The date portion is set to today.
inCreatorat line574
staticCreator
createFromTimeString(string$time,DateTimeZone|string|null$tz =null)
Create a Carbon instance from a time string. The date portion is set to today.
inCreatorat line623
staticCreator|false
rawCreateFromFormat(string$format,string$time,DateTimeZone|string|false|null$tz =null)
Create a Carbon instance from a specific format.
inCreatorat line694
static
createFromFormat($format,$time,$tz =null)
inCreatorat line722
staticCreator|false
createFromIsoFormat(string$format,string$time,DateTimeZone|string|false|null$tz =null,string|null$locale ='en',TranslatorInterface$translator =null)
Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()).
inCreatorat line863
staticCreator|false
createFromLocaleFormat(string$format,string$locale,string$time,DateTimeZone|string|false|null$tz =null)
Create a Carbon instance from a specific format and a string in a given language.
inCreatorat line880
staticCreator|false
createFromLocaleIsoFormat(string$format,string$locale,string$time,DateTimeZone|string|false|null$tz =null)
Create a Carbon instance from a specific ISO format and a string in a given language.
inCreatorat line899
staticCreator|null
make(mixed$var)
Make a Carbon instance from given variable if possible.
Always return a new instance. Parse only strings and only these likely to be dates (skip intervals and recurrences). Throw an exception for invalid format, but otherwise return null.
inCreatorat line939
static
getLastErrors()
inDifferenceat line42
staticprotected
fixNegativeMicroseconds(CarbonInterval$diff)
inDifferenceat line86
staticprotectedCarbonInterval
fixDiffInterval(DateInterval$diff,bool$absolute)
inDifferenceat line124
diff($date =null,$absolute =false)
inDifferenceat line151
CarbonInterval
diffAsCarbonInterval(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference as a CarbonInterval instance.
Return relative interval (negative if $absolute flag is not set to true and the given date is before current one).
inDifferenceat line164
int
diffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in years
inDifferenceat line177
int
diffInQuarters(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in quarters rounded down.
inDifferenceat line190
int
diffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months rounded down.
inDifferenceat line205
int
diffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks rounded down.
inDifferenceat line218
int
diffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days rounded down.
inDifferenceat line232
int
diffInDaysFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days using a filter closure rounded down.
inDifferenceat line246
int
diffInHoursFiltered(Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours using a filter closure rounded down.
inDifferenceat line261
int
diffFiltered(CarbonInterval$ci,Closure$callback,CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference by the given interval using a filter closure.
inDifferenceat line287
int
diffInWeekdays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weekdays rounded down.
inDifferenceat line302
int
diffInWeekendDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weekend days using a filter rounded down.
inDifferenceat line317
int
diffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours rounded down.
inDifferenceat line330
int
diffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours rounded down using timestamps.
inDifferenceat line343
int
diffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes rounded down.
inDifferenceat line356
int
diffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes rounded down using timestamps.
inDifferenceat line369
int
diffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds rounded down.
inDifferenceat line393
int
diffInMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in microseconds.
inDifferenceat line412
int
diffInMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in milliseconds rounded down.
inDifferenceat line425
int
diffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds using timestamps.
inDifferenceat line442
int
diffInRealMicroseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in microseconds using timestamps.
inDifferenceat line460
int
diffInRealMilliseconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in milliseconds rounded down using timestamps.
inDifferenceat line473
float
floatDiffInSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds as float (microsecond-precision).
inDifferenceat line486
float
floatDiffInMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes as float (microsecond-precision).
inDifferenceat line499
float
floatDiffInHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours as float (microsecond-precision).
inDifferenceat line512
float
floatDiffInDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days as float (microsecond-precision).
inDifferenceat line534
float
floatDiffInWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks as float (microsecond-precision).
inDifferenceat line547
float
floatDiffInMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months as float (microsecond-precision).
inDifferenceat line582
float
floatDiffInYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in year as float (microsecond-precision).
inDifferenceat line617
float
floatDiffInRealSeconds(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in seconds as float (microsecond-precision) using timestamps.
inDifferenceat line630
float
floatDiffInRealMinutes(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in minutes as float (microsecond-precision) using timestamps.
inDifferenceat line643
float
floatDiffInRealHours(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in hours as float (microsecond-precision) using timestamps.
inDifferenceat line656
float
floatDiffInRealDays(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in days as float (microsecond-precision).
inDifferenceat line673
float
floatDiffInRealWeeks(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in weeks as float (microsecond-precision).
inDifferenceat line686
float
floatDiffInRealMonths(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in months as float (microsecond-precision) using timestamps.
inDifferenceat line721
float
floatDiffInRealYears(CarbonInterface|DateTimeInterface|string|null$date =null,bool$absolute =true)
Get the difference in year as float (microsecond-precision) using timestamps.
inDifferenceat line753
int
secondsSinceMidnight()
The number of seconds since midnight.
inDifferenceat line763
int
secondsUntilEndOfDay()
The number of seconds until 23:59:59.
inDifferenceat line815
string
diffForHumans(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).
inDifferenceat line873
string
from(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
inDifferenceat line884
since($other =null,$syntax =null,$short =false,$parts =1,$options =null)
inDifferenceat line937
string
to(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given (or now if null given) to current instance.
When comparing a value in the past to default now: 1 hour from now 5 months from now
When comparing a value in the future to default now: 1 hour ago 5 months ago
When comparing a value in the past to another value: 1 hour after 5 months after
When comparing a value in the future to another value: 1 hour before 5 months before
inDifferenceat line980
string
until(Carbon|DateTimeInterface|string|array|null$other =null,int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
inDifferenceat line1013
string
fromNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from current instance to now.
inDifferenceat line1052
string
toNow(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given to now
inDifferenceat line1085
string
ago(int|array$syntax =null,bool$short =false,int$parts =1,int$options =null)
Get the difference in a human readable format in the current locale from an other instance given to now
inDifferenceat line1102
string
timespan($other =null,$timezone =null)
Get the difference in a human readable format in the current locale from current instance to an other instance given (or now if null given).
inDifferenceat line1127
string
calendar(Carbon|DateTimeInterface|string|null$referenceTime =null,array$formats =[])
Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, or a calendar date (e.g. "10/29/2017") otherwise.
Language, date and time formats will change according to the current locale.
inMixinat line66
staticvoid
mixin(object|string$mixin)
Mix another object into the class.
inMixinat line151
staticprotectedmixed
bindMacroContext(Mixin|null$context,callable$callable)
Stack a Carbon context from inside calls of self::this() and execute a given action.
inMixinat line177
staticprotectedMixin|null
context()
Return the current context from inside a macro callee or a null if static.
inMixinat line187
staticprotectedMixin
this()
Return the current context from inside a macro callee or a new one if static.
inMacroat line57
staticvoid
macro(string$name,object|callable$macro)
Register a custom macro.
inMacroat line65
static
resetMacros()
Remove all macros and generic macros.
inMacroat line79
staticvoid
genericMacro(object|callable$macro,int$priority =0)
Register a custom macro.
inMacroat line96
staticbool
hasMacro(string$name)
Checks if macro is registered globally.
inMacroat line108
staticcallable|null
getMacro(string$name)
Get the raw callable macro registered globally for a given name.
inMacroat line120
bool
hasLocalMacro(string$name)
Checks if macro is registered globally or locally.
inMacroat line132
callable|null
getLocalMacro(string$name)
Get the raw callable macro registered globally or locally for a given name.
inModifiersat line36
staticint
getMidDayAt()
get midday/noon hour
inModifiersat line55
staticvoid
setMidDayAt(int$hour)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider mid-day is always 12pm, then if you need to test if it's an other hour, test it explicitly: $date->format('G') == 13 or to set explicitly to a given hour: $date->setTime(13, 0, 0, 0) Set midday/noon hour
inWeekat line37
static
next(int|string $day =null)
inModifiersat line162
Modifiers
previous(string|int|null$modifier =null)
Modify to the previous occurrence of a given modifier such as a day of the week. If no dayOfWeek is provided, modify to the previous occurrence of the current day of the week. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line183
Modifiers
firstOfMonth(int|null$dayOfWeek =null)
Modify to the first occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the first day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line204
Modifiers
lastOfMonth(int|null$dayOfWeek =null)
Modify to the last occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the last day of the current month. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line226
mixed
nthOfMonth(int$nth,int$dayOfWeek)
Modify to the given occurrence of a given day of the week in the current month. If the calculated occurrence is outside the scope of the current month, then return false and no modifications are made.
Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line245
Modifiers
firstOfQuarter(int|null$dayOfWeek =null)
Modify to the first occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the first day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line260
Modifiers
lastOfQuarter(int|null$dayOfWeek =null)
Modify to the last occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the last day of the current quarter. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line276
mixed
nthOfQuarter(int$nth,int$dayOfWeek)
Modify to the given occurrence of a given day of the week in the current quarter. If the calculated occurrence is outside the scope of the current quarter, then return false and no modifications are made.
Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line296
Modifiers
firstOfYear(int|null$dayOfWeek =null)
Modify to the first occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the first day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line311
Modifiers
lastOfYear(int|null$dayOfWeek =null)
Modify to the last occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the last day of the current year. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line327
mixed
nthOfYear(int$nth,int$dayOfWeek)
Modify to the given occurrence of a given day of the week in the current year. If the calculated occurrence is outside the scope of the current year, then return false and no modifications are made.
Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
inModifiersat line342
Modifiers
average(Carbon|DateTimeInterface|null$date =null)
Modify the current instance to the average of a given instance (default now) and the current instance (second-precision).
inModifiersat line355
Modifiers
closest(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)
Get the closest date from the instance (second-precision).
inModifiersat line368
Modifiers
farthest(Carbon|DateTimeInterface|mixed$date1,Carbon|DateTimeInterface|mixed$date2)
Get the farthest date from the instance (second-precision).
inModifiersat line380
Modifiers
min(Carbon|DateTimeInterface|mixed$date =null)
Get the minimum instance between a given instance (default now) and the current instance.
inModifiersat line396
Modifiers
minimum(Carbon|DateTimeInterface|mixed$date =null)
Get the minimum instance between a given instance (default now) and the current instance.
inModifiersat line408
Modifiers
max(Carbon|DateTimeInterface|mixed$date =null)
Get the maximum instance between a given instance (default now) and the current instance.
inModifiersat line424
Modifiers
maximum(Carbon|DateTimeInterface|mixed$date =null)
Get the maximum instance between a given instance (default now) and the current instance.
inModifiersat line437
modify($modify)
inModifiersat line456
Modifiers
change(string$modifier)
Similar to native modify() method of DateTime but can handle more grammars.
inCastat line31
DateTimeInterface
cast(string$className)
Cast the current instance into the given class.
at line519
staticbool
isMutable()
Returns true if the current class/instance is mutable.
inMutabilityat line41
staticbool
isImmutable()
Returns true if the current class/instance is immutable.
inMutabilityat line51
Carbon
toMutable()
Return a mutable copy of the instance.
inMutabilityat line64
CarbonImmutable
toImmutable()
Return a immutable copy of the instance.
inLocalizationat line70
static
setHumanDiffOptions(int$humanDiffOptions)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.
inLocalizationat line82
static
enableHumanDiffOption(int$humanDiffOption)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.
inLocalizationat line94
static
disableHumanDiffOption(int$humanDiffOption)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.
inLocalizationat line104
staticint
getHumanDiffOptions()
Return default humanDiff() options (merged flags as integer).
inLocalizationat line114
staticTranslatorInterface
getTranslator()
Get the default translator instance in use.
inLocalizationat line126
staticvoid
setTranslator(TranslatorInterface$translator)
Set the default translator instance to use.
inLocalizationat line136
bool
hasLocalTranslator()
Return true if the current instance has its own translator.
inLocalizationat line146
TranslatorInterface
getLocalTranslator()
Get the translator of the current instance or the default if none set.
inLocalizationat line158
$this
setLocalTranslator(TranslatorInterface$translator)
Set the translator for the current instance.
inLocalizationat line175
staticstring
getTranslationMessageWith(TranslatorInterface$translator,string$key,string|null$locale =null,string|null$default =null)
Returns raw translation message for a given key.
inLocalizationat line203
string
getTranslationMessage(string$key,string|null$locale =null,string|null$default =null,TranslatorInterface$translator =null)
Returns raw translation message for a given key.
inLocalizationat line218
staticstring
translateWith(TranslatorInterface$translator,string$key,array$parameters =[],null$number =null)
Translate using translation string or callback available.
inLocalizationat line252
string
translate(string$key,array$parameters =[],string|int|float|null$number =null,TranslatorInterface|null$translator =null,bool$altNumbers =false)
Translate using translation string or callback available.
inLocalizationat line270
string
translateNumber(int$number)
Returns the alternative number for a given integer if available in the current locale.
inLocalizationat line329
staticstring
translateTimeString(string$timeString,string|null$from =null,string|null$to =null,int$mode =CarbonInterface::TRANSLATE_ALL)
Translate a time string from a locale to an other.
inLocalizationat line425
string
translateTimeStringTo(string$timeString,string|null$to =null)
Translate a time string from the current locale ($date->locale()
) to an other.
inLocalizationat line438
$this|string
locale(string$locale =null,string...$fallbackLocales)
Get/set the locale for the current instance.
inLocalizationat line470
staticstring
getLocale()
Get the current translator locale.
inLocalizationat line483
staticbool
setLocale(string$locale)
Set the current translator locale and indicate if the source locale file exists.
Pass 'auto' as locale to use closest language from the current LC_TIME locale.
inLocalizationat line495
static
setFallbackLocale(string$locale)
Set the fallback locale.
inLocalizationat line520
staticstring|null
getFallbackLocale()
Get the fallback locale.
inLocalizationat line540
staticmixed
executeWithLocale(string$locale,callable$func)
Set the current locale to the given, execute the passed function, reset the locale to previous one, then return the result of the closure (or null if the closure was void).
inLocalizationat line557
staticbool
localeHasShortUnits(string$locale)
Returns true if the given locale is internally supported and has short-units support.
Support is considered enabled if either year, day or hour has a short variant translated.
inLocalizationat line578
staticbool
localeHasDiffSyntax(string$locale)
Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after).
Support is considered enabled if the 4 sentences are translated in the given locale.
inLocalizationat line609
staticbool
localeHasDiffOneDayWords(string$locale)
Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow).
Support is considered enabled if the 3 words are translated in the given locale.
inLocalizationat line627
staticbool
localeHasDiffTwoDayWords(string$locale)
Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow).
Support is considered enabled if the 2 words are translated in the given locale.
inLocalizationat line644
staticbool
localeHasPeriodSyntax(string$locale)
Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X).
Support is considered enabled if the 4 sentences are translated in the given locale.
inLocalizationat line661
staticarray
getAvailableLocales()
Returns the list of internally available locales and already loaded custom locales.
(It will ignore custom translator dynamic loading.)
inLocalizationat line676
staticLanguage[]
getAvailableLocalesInfo()
Returns list of Language object for each available locale. This object allow you to get the ISO name, native name, region and variant of the locale.
inLocalizationat line691
staticprotectedTranslatorInterface
translator()
Initialize the default translator instance if necessary.
inLocalizationat line710
protectedstring|null
getTranslatorLocale(null$translator =null)
Get the locale of a given translator.
If null or omitted, current local translator is used. If no local translator is in use, current global translator is used.
inLocalizationat line728
staticprotectedLocaleAwareInterface|null
getLocaleAwareTranslator(LocaleAwareInterface|null$translator =null)
Throw an error if passed object is not LocaleAwareInterface.
inOptionsat line246
static
useStrictMode(bool$strictModeEnabled =true)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method.
inOptionsat line257
staticbool
isStrictModeEnabled()
Returns true if the strict mode is globally in use, false else.
(It can be overridden in specific instances.)
inOptionsat line275
staticvoid
useMonthsOverflow(bool$monthsOverflow =true)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).
inOptionsat line291
staticvoid
resetMonthsOverflow()deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).
inOptionsat line301
staticbool
shouldOverflowMonths()
Get the month overflow global behavior (can be overridden in specific instances).
inOptionsat line319
staticvoid
useYearsOverflow(bool$yearsOverflow =true)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).
inOptionsat line335
staticvoid
resetYearsOverflow()deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use the ->settings() method. Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants are available for quarters, years, decade, centuries, millennia (singular and plural forms).
inOptionsat line345
staticbool
shouldOverflowYears()
Get the month overflow global behavior (can be overridden in specific instances).
inOptionsat line367
$this|Options
settings(array$settings)
Set specific options.
- strictMode: true|false|null
- monthOverflow: true|false|null
- yearOverflow: true|false|null
- humanDiffOptions: int|null
- toStringFormat: string|Closure|null
- toJsonFormat: string|Closure|null
- locale: string|null
- timezone: \DateTimeZone|string|int|null
- macros: array|null
- genericMacros: array|null
inOptionsat line405
array
getSettings()
Returns current local settings.
inOptionsat line438
array
__debugInfo()
Show truthy properties on var_dump().
inOptionsat line455
protected
addExtraDebugInfos($infos)
inOptionsat line27
CarbonImmutable
shiftTimezone($timezone)
Set the timezone
inIntervalRoundingat line23
protected
callRoundMethod(string$method,array$parameters)
inIntervalRoundingat line38
protected
roundWith($precision,$function)
inRoundingat line40
CarbonInterface
roundUnit(string$unit,float|int$precision =1,string$function ='round')
Round the current instance at the given unit with given precision if specified and the given function.
inRoundingat line134
CarbonInterface
floorUnit(string$unit,float|int$precision =1)
Truncate the current instance at the given unit with given precision if specified.
inRoundingat line147
CarbonInterface
ceilUnit(string$unit,float|int$precision =1)
Ceil the current instance at the given unit with given precision if specified.
inRoundingat line160
CarbonInterface
round(float|int|string|DateInterval|null$precision =1,string$function ='round')
Round the current instance second with given precision if specified.
inRoundingat line172
CarbonInterface
floor(float|int|string|DateInterval|null$precision =1)
Round the current instance second with given precision if specified.
inRoundingat line184
CarbonInterface
ceil(float|int|string|DateInterval|null$precision =1)
Ceil the current instance second with given precision if specified.
inRoundingat line196
CarbonInterface
roundWeek(int$weekStartsAt =null)
Round the current instance week.
inRoundingat line211
CarbonInterface
floorWeek(int$weekStartsAt =null)
Truncate the current instance week.
inRoundingat line223
CarbonInterface
ceilWeek(int$weekStartsAt =null)
Ceil the current instance week.
inSerializationat line73
string
serialize()
Return a serialized string of the instance.
inSerializationat line87
staticSerialization
fromSerialized(string$value)
Create an instance from a serialized string.
inSerializationat line106
static
__set_state($dump)
inSerializationat line125
array
__sleep()
Returns the list of properties to dump on serialize() called on.
inSerializationat line137
__serialize()
inSerializationat line176
__wakeup()
inSerializationat line204
__unserialize(array$data)
inSerializationat line235
jsonSerialize()
inSerializationat line258
staticvoid
serializeUsing(callable$callback)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather transform Carbon object before the serialization. JSON serialize all Carbon instances using the given callback.
inSerializationat line270
cleanupDumpProperties()
Cleanup properties attached to the public scope of DateTime when a dump of the date is requested.
foreach ($date as $_) {} serializer($date) var_export($date) get_object_vars($date)
inTestat line64
static
setTestNow(DateTimeInterface|Closure|Test|string|false|null$testNow =null)
Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: - A call to the static now() method, ex. Carbon::now() - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - When a string containing the desired time is passed to Carbon::parse().
Note the timezone parameter was left out of the examples above and has no affect as the mock value will be returned regardless of its value.
Only the moment is mocked with setTestNow(), the timezone will still be the one passed as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()).
To clear the test instance call this method using the default parameter of null.
/!\ Use this method for unit tests only.
inTestat line90
static
setTestNowAndTimezone($testNow =null,$tz =null)
Set a Carbon instance (real or mock) to be returned when a "now" instance is created. The provided instance will be returned specifically under the following conditions: - A call to the static now() method, ex. Carbon::now() - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - When a string containing the desired time is passed to Carbon::parse().
It will also align default timezone (e.g. call date_default_timezone_set()) with the second argument or if null, with the timezone of the given date object.
To clear the test instance call this method using the default parameter of null.
/!\ Use this method for unit tests only.
inTestat line127
staticmixed
withTestNow(DateTimeInterface|Closure|Test|string|false|null$testNow =null,Closure|null$callback =null)
Temporarily sets a static date to be used within the callback.
Using setTestNow to set the date, executing the callback, then clearing the test instance.
/!\ Use this method for unit tests only.
inTestat line146
staticClosure|Test
getTestNow()
Get the Carbon instance (real or mock) to be returned when a "now" instance is created.
inTestat line157
staticbool
hasTestNow()
Determine if there is a valid test instance set. A valid test instance is anything that is not null.
inTestat line169
staticprotectedCarbonImmutable|Carbon|null
getMockedTestNow(string|DateTimeZone$tz)
Get the mocked date passed in setTestNow() and if it's a Closure, execute it.
inTestat line187
staticprotected
mockConstructorParameters($time,$tz)
inTimestampat line29
staticTimestamp
createFromTimestamp(float|int|string$timestamp,DateTimeZone|string|null$tz =null)
Create a Carbon instance from a timestamp and set the timezone (use default one if not specified).
Timestamp input can be given as int, float or a string containing one or more numbers.
inTimestampat line43
staticTimestamp
createFromTimestampUTC(float|int|string$timestamp)
Create a Carbon instance from an timestamp keeping the timezone to UTC.
Timestamp input can be given as int, float or a string containing one or more numbers.
inTimestampat line63
staticTimestamp
createFromTimestampMsUTC(float|int|string$timestamp)
Create a Carbon instance from a timestamp in milliseconds.
Timestamp input can be given as int, float or a string containing one or more numbers.
inTimestampat line88
staticTimestamp
createFromTimestampMs(float|int|string$timestamp,DateTimeZone|string|null$tz =null)
Create a Carbon instance from a timestamp in milliseconds.
Timestamp input can be given as int, float or a string containing one or more numbers.
inTimestampat line103
Timestamp
timestamp(float|int|string$unixTimestamp)
Set the instance's timestamp.
Timestamp input can be given as int, float or a string containing one or more numbers.
inTimestampat line126
float
getPreciseTimestamp(int$precision =6)
Returns a timestamp rounded with the given precision (6 by default).
inTimestampat line136
float
valueOf()
Returns the milliseconds timestamps used amongst other by Date javascript objects.
inTimestampat line146
int
getTimestampMs()
Returns the timestamp with millisecond precision.
inTimestampat line158
int
unix()
inUnitsat line38
Units
addRealUnit(string$unit,int$value =1)
Add seconds to the instance using timestamp. Positive $value travels forward while negative $value travels into the past.
inUnitsat line139
subRealUnit($unit,$value =1)
inUnitsat line151
staticbool
isModifiableUnit(string$unit)
Returns true if a property can be changed via setter.
inUnitsat line178
Units
rawAdd(DateInterval$interval)
Call native PHP DateTime/DateTimeImmutable add() method.
inUnitsat line197
add($unit,$value =1,$overflow =null)
inUnitsat line231
Units
addUnit(string$unit,int$value =1,bool|null$overflow =null)
Add given units to the current instance.
inUnitsat line329
Units
subUnit(string$unit,int$value =1,bool|null$overflow =null)
Subtract given units to the current instance.
inUnitsat line341
Units
rawSub(DateInterval$interval)
Call native PHP DateTime/DateTimeImmutable sub() method.
inUnitsat line360
sub($unit,$value =1,$overflow =null)
inUnitsat line396
Units
subtract(string|DateInterval$unit,int$value =1,bool|null$overflow =null)
Subtract given units or interval to the current instance.
inWeekat line50
int|Week
isoWeekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)
Set/get the week number of year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
inWeekat line70
int|Week
weekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)
Set/get the week number of year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
inWeekat line132
int
isoWeeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)
Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
inWeekat line150
int
weeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)
Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
inWeekat line180
int|Week
week(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)
Get/set the week number using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
inWeekat line211
int|Week
isoWeek(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)
Get/set the week number using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
inWeekat line37
static
addWeeks(int $weeks =1)
inWeekat line37
static
dayOfYear(int $dayOfYear)
inWeekat line37
static
subWeeks(int $weeks =1)
inWeekat line37
static
year(int $year =null)
inDateat line623
staticprotectedCarbonTimeZone|false
safeCreateDateTimeZone(DateTimeZone|string|int|null$object,DateTimeZone|string|int|null$objectDump =null)
Creates a DateTimeZone from a string, DateTimeZone or integer offset.
inDateat line636
getTimezone()
inDateat line646
staticprotectedarray
getRangesByUnit(int$daysInMonth =31)
List of minimum and maximums for each unit.
inDateat line694
Date
avoidMutation()
Clone the current instance if it's mutable.
This method is convenient to ensure you don't mutate the initial object but avoid to make a useless copy of it if it's already immutable.
inDateat line721
staticprotected
expectDateTime(mixed$date,string|array$other =[])
Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface.
inDateat line768
protectedDate
resolveUTC(Carbon|DateTimeInterface|string|null$date =null)
Return the Carbon instance passed through, a now instance in UTC if null given or parse the input if string given (using current timezone then switching to UTC).
inDateat line791
Date
carbonize(Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null$date =null)
Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
inDateat line817
string|int|bool|DateTimeZone|null
__get(string$name)
Get a part of the Carbon object
inDateat line831
string|int|bool|DateTimeZone|null
get(string$name)
Get a part of the Carbon object
inDateat line1087
bool
__isset(string$name)
Check if an attribute exists on the object
inDateat line1108
void
__set(string$name,string|int|DateTimeZone$value)
Set a part of the Carbon object
inDateat line1129
$this
set(string|array$name,string|int|DateTimeZone$value =null)
Set a part of the Carbon object
inDateat line1250
protected
getTranslatedFormByRegExp($baseKey,$keySuffix,$context,$subKey,$defaultValue)
inDateat line1279
string
getTranslatedDayName(string|null$context =null,string$keySuffix ='',string|null$defaultValue =null)
Get the translation of the current week day name (with context for languages with multiple forms).
inDateat line1291
string
getTranslatedShortDayName(string|null$context =null)
Get the translation of the current short week day name (with context for languages with multiple forms).
inDateat line1303
string
getTranslatedMinDayName(string|null$context =null)
Get the translation of the current abbreviated week day name (with context for languages with multiple forms).
inDateat line1317
string
getTranslatedMonthName(string|null$context =null,string$keySuffix ='',string|null$defaultValue =null)
Get the translation of the current month day name (with context for languages with multiple forms).
inDateat line1329
string
getTranslatedShortMonthName(string|null$context =null)
Get the translation of the current short month day name (with context for languages with multiple forms).
inDateat line1355
Date|int
weekday(int|null$value =null)
Get/set the weekday from 0 (Sunday) to 6 (Saturday).
inDateat line1369
Date|int
isoWeekday(int|null$value =null)
Get/set the ISO weekday from 1 (Monday) to 7 (Sunday).
inDateat line1385
Date
setUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)
Set any unit to a new value without overflowing current other unit given.
inDateat line1414
Date
addUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)
Add any unit to a new value without overflowing current other unit given.
inDateat line1428
Date
subUnitNoOverflow(string$valueUnit,int$value,string$overflowUnit)
Subtract any unit to a new value without overflowing current other unit given.
inDateat line1440
int|Date
utcOffset(int$minuteOffset =null)
Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed.
inDateat line1461
setDate($year,$month,$day)
inDateat line1478
setISODate($year,$week,$day =1)
inDateat line1496
Date
setDateTime(int$year,int$month,int$day,int$hour,int$minute,int$second =0,int$microseconds =0)
Set the date and time all together.
inDateat line1514
setTime($hour,$minute,$second =0,$microseconds =0)
inDateat line1529
setTimestamp($unixTimestamp)
inDateat line1559
Date
timezone(DateTimeZone|string$value)
inDateat line1571
Date|string
tz(DateTimeZone|string$value =null)
Set the timezone or returns the timezone name if no arguments passed.
inDateat line1588
setTimezone($value)
inDateat line1632
Date
setDateFrom(Carbon|DateTimeInterface$date =null)
Set the year, month, and date for this instance to that of the passed instance.
inDateat line1646
Date
setTimeFrom(Carbon|DateTimeInterface$date =null)
Set the hour, minute, second and microseconds for this instance to that of the passed instance.
inDateat line1660
Date
setDateTimeFrom(Carbon|DateTimeInterface$date =null)
Set the date and time for this instance to that of the passed instance.
inDateat line1672
staticarray
getDays()
Get the days of the week
inDateat line1694
staticint
getWeekStartsAt()
Get the first day of week
inDateat line1715
staticvoid
setWeekStartsAt(int|string$day)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the 'first_day_of_week' locale setting to change the start of week according to current locale selected and implicitly the end of week. Set the first day of week
inDateat line1725
staticint
getWeekEndsAt()
Get the last day of week
inDateat line1747
staticvoid
setWeekEndsAt(int|string$day)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the start of week according to current locale selected and implicitly the end of week. Set the last day of week
inDateat line1757
staticarray
getWeekendDays()
Get weekend days
inDateat line1789
staticvoid
setWeekendDays(array$days)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather consider week-end is always saturday and sunday, and if you have some custom week-end days to handle, give to those days an other name and create a macro for them: ``` Carbon::macro('isDayOff', function ($date) { return $date->isSunday() || $date->isMonday(); }); Carbon::macro('isNotDayOff', function ($date) { return !$date->isDayOff(); }); if ($someDate->isDayOff()) ... if ($someDate->isNotDayOff()) ... // Add 5 not-off days $count = 5; while ($someDate->isDayOff() || ($count-- > 0)) { $someDate->addDay(); } ``` Set weekend days
inDateat line1801
staticbool
hasRelativeKeywords(string$time)
Determine if a time string will produce a relative date.
inDateat line1827
static
setUtf8(bool$utf8)deprecated
deprecated To avoid conflict between different third-party libraries, static setters should not be used. You should rather use UTF-8 language packages on every machine. Set if UTF8 will be used for localized date/time.
inDateat line1844
string
formatLocalized(string$format)deprecated
deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. Use ->isoFormat() instead. Deprecated since 2.55.0
Format the instance with the current locale. You can set the current locale using setlocale() https://php.net/setlocale.
inDateat line1872
array
getIsoFormats(string|null$locale =null)
Returns list of locale formats for ISO formatting.
inDateat line1891
array
getCalendarFormats(string|null$locale =null)
Returns list of calendar formats for ISO formatting.
inDateat line1908
staticarray
getIsoUnits()
Returns list of locale units for ISO formatting.
inDateat line2042
string
getPaddedUnit(string$unit,int$length =2,string$padString ='0',int$padType =STR_PAD_LEFT)
Returns a unit of the instance padded with 0 by default or any other string if specified.
inDateat line2055
string
ordinal(string$key,string|null$period =null)
Return a property with its ordinal.
inDateat line2073
string
meridiem(bool$isLower =false)
Return the meridiem of the current time in the current locale.
inDateat line2113
string
getAltNumber(string$key)
Returns the alternative number for a given date property if available in the current locale.
inDateat line2126
string
isoFormat(string$format,string|null$originalFormat =null)
Format in the current language using ISO replacement patterns.
inDateat line2221
staticarray
getFormatsToIsoReplacements()
List of replacements from date() format to isoFormat().
inDateat line2282
string
translatedFormat(string$format)
Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) but translate words whenever possible (months, day names, etc.) using the current locale.
inDateat line2365
string
getOffsetString(string$separator =':')
Returns the offset hour and minute formatted with +/- and a given separator (":" by default).
For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something like "-12:00".
inDateat line2376
staticprotected
executeStaticCallable($macro,...$parameters)
inDateat line2399
staticmixed
__callStatic(string$method,array$parameters)
Dynamically handle calls to the class.
inDateat line2457
staticstring
singularUnit(string$unit)
Returns standardized singular of a given singular/plural unit name (in English).
inDateat line2479
staticstring
pluralUnit(string$unit)
Returns standardized plural of a given singular/plural unit name (in English).
inDateat line2494
protected
executeCallable($macro,...$parameters)
inDateat line2505
protected
executeCallableWithContext($macro,...$parameters)
inDateat line2512
staticprotected
getGenericMacros()
inDateat line2531
mixed
__call(string$method,array$parameters)
Dynamically handle calls to the class.
at line510
bool
isUtc()
Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.)
at line510
bool
isLocal()
Check if the current instance has non-UTC timezone.
at line510
bool
isValid()
Check if the current instance is a valid date.
at line510
bool
isDST()
Check if the current instance is in a daylight saving time.
at line510
bool
isSunday()
Checks if the instance day is sunday.
at line510
bool
isMonday()
Checks if the instance day is monday.
at line510
bool
isTuesday()
Checks if the instance day is tuesday.
at line510
bool
isWednesday()
Checks if the instance day is wednesday.
at line510
bool
isThursday()
Checks if the instance day is thursday.
at line510
bool
isFriday()
Checks if the instance day is friday.
at line510
bool
isSaturday()
Checks if the instance day is saturday.
at line510
bool
isSameYear(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentYear()
Checks if the instance is in the same year as the current moment.
at line510
bool
isNextYear()
Checks if the instance is in the same year as the current moment next year.
at line510
bool
isLastYear()
Checks if the instance is in the same year as the current moment last year.
at line510
bool
isSameWeek(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentWeek()
Checks if the instance is in the same week as the current moment.
at line510
bool
isNextWeek()
Checks if the instance is in the same week as the current moment next week.
at line510
bool
isLastWeek()
Checks if the instance is in the same week as the current moment last week.
at line510
bool
isSameDay(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentDay()
Checks if the instance is in the same day as the current moment.
at line510
bool
isNextDay()
Checks if the instance is in the same day as the current moment next day.
at line510
bool
isLastDay()
Checks if the instance is in the same day as the current moment last day.
at line510
bool
isSameHour(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentHour()
Checks if the instance is in the same hour as the current moment.
at line510
bool
isNextHour()
Checks if the instance is in the same hour as the current moment next hour.
at line510
bool
isLastHour()
Checks if the instance is in the same hour as the current moment last hour.
at line510
bool
isSameMinute(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentMinute()
Checks if the instance is in the same minute as the current moment.
at line510
bool
isNextMinute()
Checks if the instance is in the same minute as the current moment next minute.
at line510
bool
isLastMinute()
Checks if the instance is in the same minute as the current moment last minute.
at line510
bool
isSameSecond(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentSecond()
Checks if the instance is in the same second as the current moment.
at line510
bool
isNextSecond()
Checks if the instance is in the same second as the current moment next second.
at line510
bool
isLastSecond()
Checks if the instance is in the same second as the current moment last second.
at line510
bool
isSameMicro(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentMicro()
Checks if the instance is in the same microsecond as the current moment.
at line510
bool
isNextMicro()
Checks if the instance is in the same microsecond as the current moment next microsecond.
at line510
bool
isLastMicro()
Checks if the instance is in the same microsecond as the current moment last microsecond.
at line510
bool
isSameMicrosecond(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentMicrosecond()
Checks if the instance is in the same microsecond as the current moment.
at line510
bool
isNextMicrosecond()
Checks if the instance is in the same microsecond as the current moment next microsecond.
at line510
bool
isLastMicrosecond()
Checks if the instance is in the same microsecond as the current moment last microsecond.
at line510
bool
isCurrentMonth()
Checks if the instance is in the same month as the current moment.
at line510
bool
isNextMonth()
Checks if the instance is in the same month as the current moment next month.
at line510
bool
isLastMonth()
Checks if the instance is in the same month as the current moment last month.
at line510
bool
isCurrentQuarter()
Checks if the instance is in the same quarter as the current moment.
at line510
bool
isNextQuarter()
Checks if the instance is in the same quarter as the current moment next quarter.
at line510
bool
isLastQuarter()
Checks if the instance is in the same quarter as the current moment last quarter.
at line510
bool
isSameDecade(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentDecade()
Checks if the instance is in the same decade as the current moment.
at line510
bool
isNextDecade()
Checks if the instance is in the same decade as the current moment next decade.
at line510
bool
isLastDecade()
Checks if the instance is in the same decade as the current moment last decade.
at line510
bool
isSameCentury(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentCentury()
Checks if the instance is in the same century as the current moment.
at line510
bool
isNextCentury()
Checks if the instance is in the same century as the current moment next century.
at line510
bool
isLastCentury()
Checks if the instance is in the same century as the current moment last century.
at line510
bool
isSameMillennium(Carbon|DateTimeInterface|string|null $date =null)
Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone).
at line510
bool
isCurrentMillennium()
Checks if the instance is in the same millennium as the current moment.
at line510
bool
isNextMillennium()
Checks if the instance is in the same millennium as the current moment next millennium.
at line510
bool
isLastMillennium()
Checks if the instance is in the same millennium as the current moment last millennium.
inDateat line527
CarbonInterface
years(int $value)
Set current instance year to the given value.
inDateat line527
CarbonInterface
setYears(int $value)
Set current instance year to the given value.
inDateat line527
CarbonInterface
setYear(int $value)
Set current instance year to the given value.
inDateat line527
CarbonInterface
months(int $value)
Set current instance month to the given value.
inDateat line527
CarbonInterface
month(int $value)
Set current instance month to the given value.
inDateat line527
CarbonInterface
setMonths(int $value)
Set current instance month to the given value.
inDateat line527
CarbonInterface
setMonth(int $value)
Set current instance month to the given value.
inDateat line527
CarbonInterface
days(int $value)
Set current instance day to the given value.
inDateat line527
CarbonInterface
day(int $value)
Set current instance day to the given value.
inDateat line527
CarbonInterface
setDays(int $value)
Set current instance day to the given value.
inDateat line527
CarbonInterface
setDay(int $value)
Set current instance day to the given value.
inDateat line527
CarbonInterface
hours(int $value)
Set current instance hour to the given value.
inDateat line527
CarbonInterface
hour(int $value)
Set current instance hour to the given value.
inDateat line527
CarbonInterface
setHours(int $value)
Set current instance hour to the given value.
inDateat line527
CarbonInterface
setHour(int $value)
Set current instance hour to the given value.
inDateat line527
CarbonInterface
minutes(int $value)
Set current instance minute to the given value.
inDateat line527
CarbonInterface
minute(int $value)
Set current instance minute to the given value.
inDateat line527
CarbonInterface
setMinutes(int $value)
Set current instance minute to the given value.
inDateat line527
CarbonInterface
setMinute(int $value)
Set current instance minute to the given value.
inDateat line527
CarbonInterface
seconds(int $value)
Set current instance second to the given value.
inDateat line527
CarbonInterface
second(int $value)
Set current instance second to the given value.
inDateat line527
CarbonInterface
setSeconds(int $value)
Set current instance second to the given value.
inDateat line527
CarbonInterface
setSecond(int $value)
Set current instance second to the given value.
inDateat line527
CarbonInterface
millis(int $value)
Set current instance millisecond to the given value.
inDateat line527
CarbonInterface
milli(int $value)
Set current instance millisecond to the given value.
inDateat line527
CarbonInterface
setMillis(int $value)
Set current instance millisecond to the given value.
inDateat line527
CarbonInterface
setMilli(int $value)
Set current instance millisecond to the given value.
inDateat line527
CarbonInterface
milliseconds(int $value)
Set current instance millisecond to the given value.
inDateat line527
CarbonInterface
millisecond(int $value)
Set current instance millisecond to the given value.
inDateat line527
CarbonInterface
setMilliseconds(int $value)
Set current instance millisecond to the given value.
inDateat line527
CarbonInterface
setMillisecond(int $value)
Set current instance millisecond to the given value.
inDateat line527
CarbonInterface
micros(int $value)
Set current instance microsecond to the given value.
inDateat line527
CarbonInterface
micro(int $value)
Set current instance microsecond to the given value.
inDateat line527
CarbonInterface
setMicros(int $value)
Set current instance microsecond to the given value.
inDateat line527
CarbonInterface
setMicro(int $value)
Set current instance microsecond to the given value.
inDateat line527
CarbonInterface
microseconds(int $value)
Set current instance microsecond to the given value.
inDateat line527
CarbonInterface
microsecond(int $value)
Set current instance microsecond to the given value.
inDateat line527
CarbonInterface
setMicroseconds(int $value)
Set current instance microsecond to the given value.
inDateat line527
CarbonInterface
setMicrosecond(int $value)
Set current instance microsecond to the given value.
inDateat line527
CarbonInterface
addYears(int $value =1)
Add years (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addYear()
Add one year to the instance (using date interval).
inDateat line527
CarbonInterface
subYears(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subYear()
Sub one year to the instance (using date interval).
inDateat line527
CarbonInterface
addYearsWithOverflow(int $value =1)
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addYearWithOverflow()
Add one year to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subYearsWithOverflow(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subYearWithOverflow()
Sub one year to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addYearsWithoutOverflow(int $value =1)
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addYearWithoutOverflow()
Add one year to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subYearsWithoutOverflow(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subYearWithoutOverflow()
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addYearsWithNoOverflow(int $value =1)
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addYearWithNoOverflow()
Add one year to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subYearsWithNoOverflow(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subYearWithNoOverflow()
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addYearsNoOverflow(int $value =1)
Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addYearNoOverflow()
Add one year to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subYearsNoOverflow(int $value =1)
Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subYearNoOverflow()
Sub one year to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMonths(int $value =1)
Add months (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addMonth()
Add one month to the instance (using date interval).
inDateat line527
CarbonInterface
subMonths(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subMonth()
Sub one month to the instance (using date interval).
inDateat line527
CarbonInterface
addMonthsWithOverflow(int $value =1)
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addMonthWithOverflow()
Add one month to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subMonthsWithOverflow(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subMonthWithOverflow()
Sub one month to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addMonthsWithoutOverflow(int $value =1)
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMonthWithoutOverflow()
Add one month to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMonthsWithoutOverflow(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMonthWithoutOverflow()
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMonthsWithNoOverflow(int $value =1)
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMonthWithNoOverflow()
Add one month to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMonthsWithNoOverflow(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMonthWithNoOverflow()
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMonthsNoOverflow(int $value =1)
Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMonthNoOverflow()
Add one month to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMonthsNoOverflow(int $value =1)
Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMonthNoOverflow()
Sub one month to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addDays(int $value =1)
Add days (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addDay()
Add one day to the instance (using date interval).
inDateat line527
CarbonInterface
subDays(int $value =1)
Sub days (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subDay()
Sub one day to the instance (using date interval).
inDateat line527
CarbonInterface
addHours(int $value =1)
Add hours (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addHour()
Add one hour to the instance (using date interval).
inDateat line527
CarbonInterface
subHours(int $value =1)
Sub hours (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subHour()
Sub one hour to the instance (using date interval).
inDateat line527
CarbonInterface
addMinutes(int $value =1)
Add minutes (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addMinute()
Add one minute to the instance (using date interval).
inDateat line527
CarbonInterface
subMinutes(int $value =1)
Sub minutes (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subMinute()
Sub one minute to the instance (using date interval).
inDateat line527
CarbonInterface
addSeconds(int $value =1)
Add seconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addSecond()
Add one second to the instance (using date interval).
inDateat line527
CarbonInterface
subSeconds(int $value =1)
Sub seconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subSecond()
Sub one second to the instance (using date interval).
inDateat line527
CarbonInterface
addMillis(int $value =1)
Add milliseconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addMilli()
Add one millisecond to the instance (using date interval).
inDateat line527
CarbonInterface
subMillis(int $value =1)
Sub milliseconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subMilli()
Sub one millisecond to the instance (using date interval).
inDateat line527
CarbonInterface
addMilliseconds(int $value =1)
Add milliseconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addMillisecond()
Add one millisecond to the instance (using date interval).
inDateat line527
CarbonInterface
subMilliseconds(int $value =1)
Sub milliseconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subMillisecond()
Sub one millisecond to the instance (using date interval).
inDateat line527
CarbonInterface
addMicros(int $value =1)
Add microseconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addMicro()
Add one microsecond to the instance (using date interval).
inDateat line527
CarbonInterface
subMicros(int $value =1)
Sub microseconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subMicro()
Sub one microsecond to the instance (using date interval).
inDateat line527
CarbonInterface
addMicroseconds(int $value =1)
Add microseconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addMicrosecond()
Add one microsecond to the instance (using date interval).
inDateat line527
CarbonInterface
subMicroseconds(int $value =1)
Sub microseconds (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subMicrosecond()
Sub one microsecond to the instance (using date interval).
inDateat line527
CarbonInterface
addMillennia(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addMillennium()
Add one millennium to the instance (using date interval).
inDateat line527
CarbonInterface
subMillennia(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subMillennium()
Sub one millennium to the instance (using date interval).
inDateat line527
CarbonInterface
addMillenniaWithOverflow(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addMillenniumWithOverflow()
Add one millennium to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subMillenniaWithOverflow(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subMillenniumWithOverflow()
Sub one millennium to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addMillenniaWithoutOverflow(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMillenniumWithoutOverflow()
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMillenniaWithoutOverflow(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMillenniumWithoutOverflow()
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMillenniaWithNoOverflow(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMillenniumWithNoOverflow()
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMillenniaWithNoOverflow(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMillenniumWithNoOverflow()
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMillenniaNoOverflow(int $value =1)
Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addMillenniumNoOverflow()
Add one millennium to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMillenniaNoOverflow(int $value =1)
Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subMillenniumNoOverflow()
Sub one millennium to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addCenturies(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addCentury()
Add one century to the instance (using date interval).
inDateat line527
CarbonInterface
subCenturies(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subCentury()
Sub one century to the instance (using date interval).
inDateat line527
CarbonInterface
addCenturiesWithOverflow(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addCenturyWithOverflow()
Add one century to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subCenturiesWithOverflow(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subCenturyWithOverflow()
Sub one century to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addCenturiesWithoutOverflow(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addCenturyWithoutOverflow()
Add one century to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subCenturiesWithoutOverflow(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subCenturyWithoutOverflow()
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addCenturiesWithNoOverflow(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addCenturyWithNoOverflow()
Add one century to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subCenturiesWithNoOverflow(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subCenturyWithNoOverflow()
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addCenturiesNoOverflow(int $value =1)
Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addCenturyNoOverflow()
Add one century to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subCenturiesNoOverflow(int $value =1)
Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subCenturyNoOverflow()
Sub one century to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addDecades(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addDecade()
Add one decade to the instance (using date interval).
inDateat line527
CarbonInterface
subDecades(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subDecade()
Sub one decade to the instance (using date interval).
inDateat line527
CarbonInterface
addDecadesWithOverflow(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addDecadeWithOverflow()
Add one decade to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subDecadesWithOverflow(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subDecadeWithOverflow()
Sub one decade to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addDecadesWithoutOverflow(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addDecadeWithoutOverflow()
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subDecadesWithoutOverflow(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subDecadeWithoutOverflow()
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addDecadesWithNoOverflow(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addDecadeWithNoOverflow()
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subDecadesWithNoOverflow(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subDecadeWithNoOverflow()
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addDecadesNoOverflow(int $value =1)
Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addDecadeNoOverflow()
Add one decade to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subDecadesNoOverflow(int $value =1)
Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subDecadeNoOverflow()
Sub one decade to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addQuarters(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addQuarter()
Add one quarter to the instance (using date interval).
inDateat line527
CarbonInterface
subQuarters(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subQuarter()
Sub one quarter to the instance (using date interval).
inDateat line527
CarbonInterface
addQuartersWithOverflow(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addQuarterWithOverflow()
Add one quarter to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subQuartersWithOverflow(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
subQuarterWithOverflow()
Sub one quarter to the instance (using date interval) with overflow explicitly allowed.
inDateat line527
CarbonInterface
addQuartersWithoutOverflow(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addQuarterWithoutOverflow()
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subQuartersWithoutOverflow(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subQuarterWithoutOverflow()
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addQuartersWithNoOverflow(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addQuarterWithNoOverflow()
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subQuartersWithNoOverflow(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subQuarterWithNoOverflow()
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addQuartersNoOverflow(int $value =1)
Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addQuarterNoOverflow()
Add one quarter to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subQuartersNoOverflow(int $value =1)
Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
subQuarterNoOverflow()
Sub one quarter to the instance (using date interval) with overflow explicitly forbidden.
inDateat line527
CarbonInterface
addWeek()
Add one week to the instance (using date interval).
inDateat line527
CarbonInterface
subWeek()
Sub one week to the instance (using date interval).
inDateat line527
CarbonInterface
addWeekdays(int $value =1)
Add weekdays (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
addWeekday()
Add one weekday to the instance (using date interval).
inDateat line527
CarbonInterface
subWeekdays(int $value =1)
Sub weekdays (the $value count passed in) to the instance (using date interval).
inDateat line527
CarbonInterface
subWeekday()
Sub one weekday to the instance (using date interval).
inDateat line527
CarbonInterface
addRealMicros(int $value =1)
Add microseconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealMicro()
Add one microsecond to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMicros(int $value =1)
Sub microseconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMicro()
Sub one microsecond to the instance (using timestamp).
at line510
CarbonPeriod
microsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
inDateat line527
CarbonInterface
addRealMicroseconds(int $value =1)
Add microseconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealMicrosecond()
Add one microsecond to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMicroseconds(int $value =1)
Sub microseconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMicrosecond()
Sub one microsecond to the instance (using timestamp).
at line510
CarbonPeriod
microsecondsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given.
inDateat line527
CarbonInterface
addRealMillis(int $value =1)
Add milliseconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealMilli()
Add one millisecond to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMillis(int $value =1)
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMilli()
Sub one millisecond to the instance (using timestamp).
at line510
CarbonPeriod
millisUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
inDateat line527
CarbonInterface
addRealMilliseconds(int $value =1)
Add milliseconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealMillisecond()
Add one millisecond to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMilliseconds(int $value =1)
Sub milliseconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMillisecond()
Sub one millisecond to the instance (using timestamp).
at line510
CarbonPeriod
millisecondsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given.
inDateat line527
CarbonInterface
addRealSeconds(int $value =1)
Add seconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealSecond()
Add one second to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealSeconds(int $value =1)
Sub seconds (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealSecond()
Sub one second to the instance (using timestamp).
at line510
CarbonPeriod
secondsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given.
inDateat line527
CarbonInterface
addRealMinutes(int $value =1)
Add minutes (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealMinute()
Add one minute to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMinutes(int $value =1)
Sub minutes (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMinute()
Sub one minute to the instance (using timestamp).
at line510
CarbonPeriod
minutesUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given.
inDateat line527
CarbonInterface
addRealHours(int $value =1)
Add hours (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealHour()
Add one hour to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealHours(int $value =1)
Sub hours (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealHour()
Sub one hour to the instance (using timestamp).
at line510
CarbonPeriod
hoursUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given.
inDateat line527
CarbonInterface
addRealDays(int $value =1)
Add days (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealDay()
Add one day to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealDays(int $value =1)
Sub days (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealDay()
Sub one day to the instance (using timestamp).
at line510
CarbonPeriod
daysUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given.
inDateat line527
CarbonInterface
addRealWeeks(int $value =1)
Add weeks (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealWeek()
Add one week to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealWeeks(int $value =1)
Sub weeks (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealWeek()
Sub one week to the instance (using timestamp).
at line510
CarbonPeriod
weeksUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given.
inDateat line527
CarbonInterface
addRealMonths(int $value =1)
Add months (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealMonth()
Add one month to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMonths(int $value =1)
Sub months (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMonth()
Sub one month to the instance (using timestamp).
at line510
CarbonPeriod
monthsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given.
inDateat line527
CarbonInterface
addRealQuarters(int $value =1)
Add quarters (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealQuarter()
Add one quarter to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealQuarters(int $value =1)
Sub quarters (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealQuarter()
Sub one quarter to the instance (using timestamp).
at line510
CarbonPeriod
quartersUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given.
inDateat line527
CarbonInterface
addRealYears(int $value =1)
Add years (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealYear()
Add one year to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealYears(int $value =1)
Sub years (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealYear()
Sub one year to the instance (using timestamp).
at line510
CarbonPeriod
yearsUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given.
inDateat line527
CarbonInterface
addRealDecades(int $value =1)
Add decades (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealDecade()
Add one decade to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealDecades(int $value =1)
Sub decades (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealDecade()
Sub one decade to the instance (using timestamp).
at line510
CarbonPeriod
decadesUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given.
inDateat line527
CarbonInterface
addRealCenturies(int $value =1)
Add centuries (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealCentury()
Add one century to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealCenturies(int $value =1)
Sub centuries (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealCentury()
Sub one century to the instance (using timestamp).
at line510
CarbonPeriod
centuriesUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given.
inDateat line527
CarbonInterface
addRealMillennia(int $value =1)
Add millennia (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
addRealMillennium()
Add one millennium to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMillennia(int $value =1)
Sub millennia (the $value count passed in) to the instance (using timestamp).
inDateat line527
CarbonInterface
subRealMillennium()
Sub one millennium to the instance (using timestamp).
at line510
CarbonPeriod
millenniaUntil($endDate =null,int $factor =1)
Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given.
inDateat line527
CarbonInterface
roundYear(float $precision =1,string $function ="round")
Round the current instance year with given precision using the given function.
inDateat line527
CarbonInterface
roundYears(float $precision =1,string $function ="round")
Round the current instance year with given precision using the given function.
inDateat line527
CarbonInterface
floorYear(float $precision =1)
Truncate the current instance year with given precision.
inDateat line527
CarbonInterface
floorYears(float $precision =1)
Truncate the current instance year with given precision.
inDateat line527
CarbonInterface
ceilYear(float $precision =1)
Ceil the current instance year with given precision.
inDateat line527
CarbonInterface
ceilYears(float $precision =1)
Ceil the current instance year with given precision.
inDateat line527
CarbonInterface
roundMonth(float $precision =1,string $function ="round")
Round the current instance month with given precision using the given function.
inDateat line527
CarbonInterface
roundMonths(float $precision =1,string $function ="round")
Round the current instance month with given precision using the given function.
inDateat line527
CarbonInterface
floorMonth(float $precision =1)
Truncate the current instance month with given precision.
inDateat line527
CarbonInterface
floorMonths(float $precision =1)
Truncate the current instance month with given precision.
inDateat line527
CarbonInterface
ceilMonth(float $precision =1)
Ceil the current instance month with given precision.
inDateat line527
CarbonInterface
ceilMonths(float $precision =1)
Ceil the current instance month with given precision.
inDateat line527
CarbonInterface
roundDay(float $precision =1,string $function ="round")
Round the current instance day with given precision using the given function.
inDateat line527
CarbonInterface
roundDays(float $precision =1,string $function ="round")
Round the current instance day with given precision using the given function.
inDateat line527
CarbonInterface
floorDay(float $precision =1)
Truncate the current instance day with given precision.
inDateat line527
CarbonInterface
floorDays(float $precision =1)
Truncate the current instance day with given precision.
inDateat line527
CarbonInterface
ceilDay(float $precision =1)
Ceil the current instance day with given precision.
inDateat line527
CarbonInterface
ceilDays(float $precision =1)
Ceil the current instance day with given precision.
inDateat line527
CarbonInterface
roundHour(float $precision =1,string $function ="round")
Round the current instance hour with given precision using the given function.
inDateat line527
CarbonInterface
roundHours(float $precision =1,string $function ="round")
Round the current instance hour with given precision using the given function.
inDateat line527
CarbonInterface
floorHour(float $precision =1)
Truncate the current instance hour with given precision.
inDateat line527
CarbonInterface
floorHours(float $precision =1)
Truncate the current instance hour with given precision.
inDateat line527
CarbonInterface
ceilHour(float $precision =1)
Ceil the current instance hour with given precision.
inDateat line527
CarbonInterface
ceilHours(float $precision =1)
Ceil the current instance hour with given precision.
inDateat line527
CarbonInterface
roundMinute(float $precision =1,string $function ="round")
Round the current instance minute with given precision using the given function.
inDateat line527
CarbonInterface
roundMinutes(float $precision =1,string $function ="round")
Round the current instance minute with given precision using the given function.
inDateat line527
CarbonInterface
floorMinute(float $precision =1)
Truncate the current instance minute with given precision.
inDateat line527
CarbonInterface
floorMinutes(float $precision =1)
Truncate the current instance minute with given precision.
inDateat line527
CarbonInterface
ceilMinute(float $precision =1)
Ceil the current instance minute with given precision.
inDateat line527
CarbonInterface
ceilMinutes(float $precision =1)
Ceil the current instance minute with given precision.
inDateat line527
CarbonInterface
roundSecond(float $precision =1,string $function ="round")
Round the current instance second with given precision using the given function.
inDateat line527
CarbonInterface
roundSeconds(float $precision =1,string $function ="round")
Round the current instance second with given precision using the given function.
inDateat line527
CarbonInterface
floorSecond(float $precision =1)
Truncate the current instance second with given precision.
inDateat line527
CarbonInterface
floorSeconds(float $precision =1)
Truncate the current instance second with given precision.
inDateat line527
CarbonInterface
ceilSecond(float $precision =1)
Ceil the current instance second with given precision.
inDateat line527
CarbonInterface
ceilSeconds(float $precision =1)
Ceil the current instance second with given precision.
inDateat line527
CarbonInterface
roundMillennium(float $precision =1,string $function ="round")
Round the current instance millennium with given precision using the given function.
inDateat line527
CarbonInterface
roundMillennia(float $precision =1,string $function ="round")
Round the current instance millennium with given precision using the given function.
inDateat line527
CarbonInterface
floorMillennium(float $precision =1)
Truncate the current instance millennium with given precision.
inDateat line527
CarbonInterface
floorMillennia(float $precision =1)
Truncate the current instance millennium with given precision.
inDateat line527
CarbonInterface
ceilMillennium(float $precision =1)
Ceil the current instance millennium with given precision.
inDateat line527
CarbonInterface
ceilMillennia(float $precision =1)
Ceil the current instance millennium with given precision.
inDateat line527
CarbonInterface
roundCentury(float $precision =1,string $function ="round")
Round the current instance century with given precision using the given function.
inDateat line527
CarbonInterface
roundCenturies(float $precision =1,string $function ="round")
Round the current instance century with given precision using the given function.
inDateat line527
CarbonInterface
floorCentury(float $precision =1)
Truncate the current instance century with given precision.
inDateat line527
CarbonInterface
floorCenturies(float $precision =1)
Truncate the current instance century with given precision.
inDateat line527
CarbonInterface
ceilCentury(float $precision =1)
Ceil the current instance century with given precision.
inDateat line527
CarbonInterface
ceilCenturies(float $precision =1)
Ceil the current instance century with given precision.
inDateat line527
CarbonInterface
roundDecade(float $precision =1,string $function ="round")
Round the current instance decade with given precision using the given function.
inDateat line527
CarbonInterface
roundDecades(float $precision =1,string $function ="round")
Round the current instance decade with given precision using the given function.
inDateat line527
CarbonInterface
floorDecade(float $precision =1)
Truncate the current instance decade with given precision.
inDateat line527
CarbonInterface
floorDecades(float $precision =1)
Truncate the current instance decade with given precision.
inDateat line527
CarbonInterface
ceilDecade(float $precision =1)
Ceil the current instance decade with given precision.
inDateat line527
CarbonInterface
ceilDecades(float $precision =1)
Ceil the current instance decade with given precision.
inDateat line527
CarbonInterface
roundQuarter(float $precision =1,string $function ="round")
Round the current instance quarter with given precision using the given function.
inDateat line527
CarbonInterface
roundQuarters(float $precision =1,string $function ="round")
Round the current instance quarter with given precision using the given function.
inDateat line527
CarbonInterface
floorQuarter(float $precision =1)
Truncate the current instance quarter with given precision.
inDateat line527
CarbonInterface
floorQuarters(float $precision =1)
Truncate the current instance quarter with given precision.
inDateat line527
CarbonInterface
ceilQuarter(float $precision =1)
Ceil the current instance quarter with given precision.
inDateat line527
CarbonInterface
ceilQuarters(float $precision =1)
Ceil the current instance quarter with given precision.
inDateat line527
CarbonInterface
roundMillisecond(float $precision =1,string $function ="round")
Round the current instance millisecond with given precision using the given function.
inDateat line527
CarbonInterface
roundMilliseconds(float $precision =1,string $function ="round")
Round the current instance millisecond with given precision using the given function.
inDateat line527
CarbonInterface
floorMillisecond(float $precision =1)
Truncate the current instance millisecond with given precision.
inDateat line527
CarbonInterface
floorMilliseconds(float $precision =1)
Truncate the current instance millisecond with given precision.
inDateat line527
CarbonInterface
ceilMillisecond(float $precision =1)
Ceil the current instance millisecond with given precision.
inDateat line527
CarbonInterface
ceilMilliseconds(float $precision =1)
Ceil the current instance millisecond with given precision.
inDateat line527
CarbonInterface
roundMicrosecond(float $precision =1,string $function ="round")
Round the current instance microsecond with given precision using the given function.
inDateat line527
CarbonInterface
roundMicroseconds(float $precision =1,string $function ="round")
Round the current instance microsecond with given precision using the given function.
inDateat line527
CarbonInterface
floorMicrosecond(float $precision =1)
Truncate the current instance microsecond with given precision.
inDateat line527
CarbonInterface
floorMicroseconds(float $precision =1)
Truncate the current instance microsecond with given precision.
inDateat line527
CarbonInterface
ceilMicrosecond(float $precision =1)
Ceil the current instance microsecond with given precision.
inDateat line527
CarbonInterface
ceilMicroseconds(float $precision =1)
Ceil the current instance microsecond with given precision.
at line510
string
shortAbsoluteDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line510
string
longAbsoluteDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line510
string
shortRelativeDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line510
string
longRelativeDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line510
string
shortRelativeToNowDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line510
string
longRelativeToNowDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line510
string
shortRelativeToOtherDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)
at line510
string
longRelativeToOtherDiffForHumans(DateTimeInterface $other =null,int $parts =1)
Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.)