Pionia Core

Boundaries

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

$quarter

public int $quarter

Depends on the following methods:

Methods

addMonths()

public addMonths(int $value = 1) : $this
Parameters
$value = 1 : int
Return values
$this

endOf()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

public setDate(int $year, int $month, int $day) : $this
Parameters
$year : int
$month : int
$day : int
Return values
$this

setTime()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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()

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

        
On this page

Search results