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 } }