Menu

## Boundaries

Boundaries.php : 38

Trait Boundaries.

startOf, endOf and derived method for each unit.

Depends on the following properties:

### Table of Contents

#### Properties

$daysInMonth : int
$month : int
$quarter : int
$year : int

#### Methods

addMonths() : $this
endOf() : static
  Modify to end of current given unit.
endOfCentury() : static
  Resets the date to end of the century and time to 23:59:59.999999
endOfDay() : static
  Resets the time to 23:59:59.999999 end of day
endOfDecade() : static
  Resets the date to end of the decade and time to 23:59:59.999999
endOfHour() : static
  Modify to end of current hour, minutes and seconds become 59
endOfMillennium() : static
  Resets the date to end of the millennium and time to 23:59:59.999999
endOfMillisecond() : static
  Modify to end of current millisecond, microseconds such as 12345 become 123999
endOfMinute() : static
  Modify to end of current minute, seconds become 59
endOfMonth() : static
  Resets the date to end of the month and time to 23:59:59.999999
endOfQuarter() : static
  Resets the date to end of the quarter and time to 23:59:59.999999
endOfSecond() : static
  Modify to end of current second, microseconds become 999999
endOfWeek() : static
  Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
endOfYear() : static
  Resets the date to end of the year and time to 23:59:59.999999
setDate() : $this
setTime() : $this
startOf() : static
  Modify to start of current given unit.
startOfCentury() : static
  Resets the date to the first day of the century and the time to 00:00:00
startOfDay() : static
  Resets the time to 00:00:00 start of day
startOfDecade() : static
  Resets the date to the first day of the decade and the time to 00:00:00
startOfHour() : static
  Modify to start of current hour, minutes and seconds become 0
startOfMillennium() : static
  Resets the date to the first day of the millennium and the time to 00:00:00
startOfMillisecond() : static
  Modify to start of current millisecond, microseconds such as 12345 become 123000
startOfMinute() : static
  Modify to start of current minute, seconds become 0
startOfMonth() : static
  Resets the date to the first day of the month and the time to 00:00:00
startOfQuarter() : static
  Resets the date to the first day of the quarter and the time to 00:00:00
startOfSecond() : static
  Modify to start of current second, microseconds become 0
startOfWeek() : static
  Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
startOfYear() : static
  Resets the date to the first day of the year and the time to 00:00:00

### Properties

#### $daysInMonth

Boundaries.php : 0
`public int $daysInMonth`

#### $month

Boundaries.php : 0
`public int $month`

#### $quarter

Boundaries.php : 0
`public int $quarter`

Depends on the following methods:

#### $year

Boundaries.php : 0
`public int $year`

### Methods

#### addMonths()

Boundaries.php : 0
`public addMonths(int $value = 1) : $this`

##### Parameters

$value = 1 : int

##### Return values

$this

#### endOf()

Boundaries.php : 459

Modify to end of current given unit.

`public endOf(Unit|string $unit, mixed ...$params) : static`

##### Parameters

$unit : Unit|string
$params : mixed

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16.334455')
        ->startOf(Unit::Month)
        ->endOf(Unit::Week, Carbon::FRIDAY);

##### Return values

static

#### endOfCentury()

Boundaries.php : 223

Resets the date to end of the century and time to 23:59:59.999999

`public endOfCentury() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfCentury();

##### Return values

static

#### endOfDay()

Boundaries.php : 65

Resets the time to 23:59:59.999999 end of day

`public endOfDay() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfDay();

##### Return values

static

#### endOfDecade()

Boundaries.php : 189

Resets the date to end of the decade and time to 23:59:59.999999

`public endOfDecade() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfDecade();

##### Return values

static

#### endOfHour()

Boundaries.php : 333

Modify to end of current hour, minutes and seconds become 59

`public endOfHour() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfHour();

##### Return values

static

#### endOfMillennium()

Boundaries.php : 257

Resets the date to end of the millennium and time to 23:59:59.999999

`public endOfMillennium() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfMillennium();

##### Return values

static

#### endOfMillisecond()

Boundaries.php : 421

Modify to end of current millisecond, microseconds such as 12345 become 123999

`public endOfMillisecond() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16.334455')
        ->endOfSecond()
        ->format('H:i:s.u');

##### Return values

static

#### endOfMinute()

Boundaries.php : 359

Modify to end of current minute, seconds become 59

`public endOfMinute() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfMinute();

##### Return values

static

#### endOfMonth()

Boundaries.php : 95

Resets the date to end of the month and time to 23:59:59.999999

`public endOfMonth() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfMonth();

##### Return values

static

#### endOfQuarter()

Boundaries.php : 127

Resets the date to end of the quarter and time to 23:59:59.999999

`public endOfQuarter() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfQuarter();

##### Return values

static

#### endOfSecond()

Boundaries.php : 389

Modify to end of current second, microseconds become 999999

`public endOfSecond() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16.334455')
        ->endOfSecond()
        ->format('H:i:s.u');

##### Return values

static

#### endOfWeek()

Boundaries.php : 302

Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999

`public endOfWeek([WeekDay|int|null $weekEndsAt = null ]) : static`

##### Parameters

$weekEndsAt : WeekDay|int|null = null

  optional end allow you to specify the day of week to use to end the week

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek() . "\n";
      echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->endOfWeek() . "\n";
      echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek(Carbon::SATURDAY) . "\n";

##### Return values

static

#### endOfYear()

Boundaries.php : 157

Resets the date to end of the year and time to 23:59:59.999999

`public endOfYear() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->endOfYear();

##### Return values

static

#### setDate()

Boundaries.php : 0
`public setDate(int $year, int $month, int $day) : $this`

##### Parameters

$year : int
$month : int
$day : int

##### Return values

$this

#### setTime()

Boundaries.php : 0
`public setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0) : $this`

##### Parameters

$hour : int
$minute : int
$second = 0 : int
$microseconds = 0 : int

##### Return values

$this

#### startOf()

Boundaries.php : 438

Modify to start of current given unit.

`public startOf(Unit|string $unit, mixed ...$params) : static`

##### Parameters

$unit : Unit|string
$params : mixed

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16.334455')
        ->startOf(Unit::Month)
        ->endOf(Unit::Week, Carbon::FRIDAY);

##### Return values

static

#### startOfCentury()

Boundaries.php : 206

Resets the date to the first day of the century and the time to 00:00:00

`public startOfCentury() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfCentury();

##### Return values

static

#### startOfDay()

Boundaries.php : 50

Resets the time to 00:00:00 start of day

`public startOfDay() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfDay();

##### Return values

static

#### startOfDecade()

Boundaries.php : 172

Resets the date to the first day of the decade and the time to 00:00:00

`public startOfDecade() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfDecade();

##### Return values

static

#### startOfHour()

Boundaries.php : 320

Modify to start of current hour, minutes and seconds become 0

`public startOfHour() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfHour();

##### Return values

static

#### startOfMillennium()

Boundaries.php : 240

Resets the date to the first day of the millennium and the time to 00:00:00

`public startOfMillennium() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfMillennium();

##### Return values

static

#### startOfMillisecond()

Boundaries.php : 404

Modify to start of current millisecond, microseconds such as 12345 become 123000

`public startOfMillisecond() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16.334455')
        ->startOfSecond()
        ->format('H:i:s.u');

##### Return values

static

#### startOfMinute()

Boundaries.php : 346

Modify to start of current minute, seconds become 0

`public startOfMinute() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfMinute();

##### Return values

static

#### startOfMonth()

Boundaries.php : 80

Resets the date to the first day of the month and the time to 00:00:00

`public startOfMonth() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfMonth();

##### Return values

static

#### startOfQuarter()

Boundaries.php : 110

Resets the date to the first day of the quarter and the time to 00:00:00

`public startOfQuarter() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfQuarter();

##### Return values

static

#### startOfSecond()

Boundaries.php : 374

Modify to start of current second, microseconds become 0

`public startOfSecond() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16.334455')
        ->startOfSecond()
        ->format('H:i:s.u');

##### Return values

static

#### startOfWeek()

Boundaries.php : 278

Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00

`public startOfWeek([WeekDay|int|null $weekStartsAt = null ]) : static`

##### Parameters

$weekStartsAt : WeekDay|int|null = null

  optional start allow you to specify the day of week to use to start the week

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek() . "\n";
      echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->startOfWeek() . "\n";
      echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek(Carbon::SUNDAY) . "\n";

##### Return values

static

#### startOfYear()

Boundaries.php : 142

Resets the date to the first day of the year and the time to 00:00:00

`public startOfYear() : static`

##### Tags

example

      echo Carbon::parse('2018-07-25 12:45:16')->startOfYear();

##### Return values

static

## Search results