Ceil the current instance second with given precision. * @method CarbonImmutable ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. * @method CarbonImmutable roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method CarbonImmutable roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. * @method CarbonImmutable floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. * @method CarbonImmutable floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. * @method CarbonImmutable ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. * @method CarbonImmutable ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. * @method CarbonImmutable roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method CarbonImmutable roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. * @method CarbonImmutable floorCentury(float $precision = 1) Truncate the current instance century with given precision. * @method CarbonImmutable floorCenturies(float $precision = 1) Truncate the current instance century with given precision. * @method CarbonImmutable ceilCentury(float $precision = 1) Ceil the current instance century with given precision. * @method CarbonImmutable ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. * @method CarbonImmutable roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method CarbonImmutable roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. * @method CarbonImmutable floorDecade(float $precision = 1) Truncate the current instance decade with given precision. * @method CarbonImmutable floorDecades(float $precision = 1) Truncate the current instance decade with given precision. * @method CarbonImmutable ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. * @method CarbonImmutable ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. * @method CarbonImmutable roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method CarbonImmutable roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. * @method CarbonImmutable floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. * @method CarbonImmutable floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. * @method CarbonImmutable ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. * @method CarbonImmutable ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. * @method CarbonImmutable roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method CarbonImmutable roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. * @method CarbonImmutable floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. * @method CarbonImmutable floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. * @method CarbonImmutable ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. * @method CarbonImmutable ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. * @method CarbonImmutable roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method CarbonImmutable roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. * @method CarbonImmutable floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. * @method CarbonImmutable floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. * @method CarbonImmutable ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. * @method CarbonImmutable ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. * @method 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.) * @method 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.) * @method 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.) * @method 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.) * @method 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.) * @method 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.) * @method 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.) * @method 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.) * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value * @method int daysInCentury() Return the number of days contained in the current century * @method int daysInDecade() Return the number of days contained in the current decade * @method int daysInMillennium() Return the number of days contained in the current millennium * @method int daysInMonth() Return the number of days contained in the current month * @method int daysInQuarter() Return the number of days contained in the current quarter * @method int daysInWeek() Return the number of days contained in the current week * @method int daysInYear() Return the number of days contained in the current year * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value * @method int decadesInCentury() Return the number of decades contained in the current century * @method int decadesInMillennium() Return the number of decades contained in the current millennium * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value * @method int hoursInCentury() Return the number of hours contained in the current century * @method int hoursInDay() Return the number of hours contained in the current day * @method int hoursInDecade() Return the number of hours contained in the current decade * @method int hoursInMillennium() Return the number of hours contained in the current millennium * @method int hoursInMonth() Return the number of hours contained in the current month * @method int hoursInQuarter() Return the number of hours contained in the current quarter * @method int hoursInWeek() Return the number of hours contained in the current week * @method int hoursInYear() Return the number of hours contained in the current year * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value * @method int microsecondsInCentury() Return the number of microseconds contained in the current century * @method int microsecondsInDay() Return the number of microseconds contained in the current day * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade * @method int microsecondsInHour() Return the number of microseconds contained in the current hour * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute * @method int microsecondsInMonth() Return the number of microseconds contained in the current month * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter * @method int microsecondsInSecond() Return the number of microseconds contained in the current second * @method int microsecondsInWeek() Return the number of microseconds contained in the current week * @method int microsecondsInYear() Return the number of microseconds contained in the current year * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century * @method int millisecondsInDay() Return the number of milliseconds contained in the current day * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week * @method int millisecondsInYear() Return the number of milliseconds contained in the current year * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value * @method int minutesInCentury() Return the number of minutes contained in the current century * @method int minutesInDay() Return the number of minutes contained in the current day * @method int minutesInDecade() Return the number of minutes contained in the current decade * @method int minutesInHour() Return the number of minutes contained in the current hour * @method int minutesInMillennium() Return the number of minutes contained in the current millennium * @method int minutesInMonth() Return the number of minutes contained in the current month * @method int minutesInQuarter() Return the number of minutes contained in the current quarter * @method int minutesInWeek() Return the number of minutes contained in the current week * @method int minutesInYear() Return the number of minutes contained in the current year * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value * @method int monthsInCentury() Return the number of months contained in the current century * @method int monthsInDecade() Return the number of months contained in the current decade * @method int monthsInMillennium() Return the number of months contained in the current millennium * @method int monthsInQuarter() Return the number of months contained in the current quarter * @method int monthsInYear() Return the number of months contained in the current year * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value * @method int quartersInCentury() Return the number of quarters contained in the current century * @method int quartersInDecade() Return the number of quarters contained in the current decade * @method int quartersInMillennium() Return the number of quarters contained in the current millennium * @method int quartersInYear() Return the number of quarters contained in the current year * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value * @method int secondsInCentury() Return the number of seconds contained in the current century * @method int secondsInDay() Return the number of seconds contained in the current day * @method int secondsInDecade() Return the number of seconds contained in the current decade * @method int secondsInHour() Return the number of seconds contained in the current hour * @method int secondsInMillennium() Return the number of seconds contained in the current millennium * @method int secondsInMinute() Return the number of seconds contained in the current minute * @method int secondsInMonth() Return the number of seconds contained in the current month * @method int secondsInQuarter() Return the number of seconds contained in the current quarter * @method int secondsInWeek() Return the number of seconds contained in the current week * @method int secondsInYear() Return the number of seconds contained in the current year * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value * @method int weeksInCentury() Return the number of weeks contained in the current century * @method int weeksInDecade() Return the number of weeks contained in the current decade * @method int weeksInMillennium() Return the number of weeks contained in the current millennium * @method int weeksInMonth() Return the number of weeks contained in the current month * @method int weeksInQuarter() Return the number of weeks contained in the current quarter * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value * @method int yearsInCentury() Return the number of years contained in the current century * @method int yearsInDecade() Return the number of years contained in the current decade * @method int yearsInMillennium() Return the number of years contained in the current millennium * * */ class CarbonImmutable extends DateTimeImmutable implements CarbonInterface { use Date { __clone as dateTraitClone; } public function __clone(): void { $this->dateTraitClone(); $this->endOfTime = false; $this->startOfTime = false; } /** * Create a very old date representing start of time. * * @return static */ public static function startOfTime(): static { $date = static::parse('0001-01-01')->years(self::getStartOfTimeYear()); $date->startOfTime = true; return $date; } /** * Create a very far date representing end of time. * * @return static */ public static function endOfTime(): static { $date = static::parse('9999-12-31 23:59:59.999999')->years(self::getEndOfTimeYear()); $date->endOfTime = true; return $date; } /** * @codeCoverageIgnore */ private static function getEndOfTimeYear(): int { return 1118290769066902787; // PHP_INT_MAX no longer work since PHP 8.1 } /** * @codeCoverageIgnore */ private static function getStartOfTimeYear(): int { return -1118290769066898816; // PHP_INT_MIN no longer work since PHP 8.1 } }