Boundaries
Trait Boundaries.
startOf, endOf and derived method for each unit.
Depends on the following properties:
Table of Contents
- $daysInMonth : int
- $month : int
- $quarter : int
- $year : int
- 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
- 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
- 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
public
int
$daysInMonth
$month
public
int
$month
$quarter
public
int
$quarter
Depends on the following methods:
$year
public
int
$year
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(string $unit, array<int, mixed> ...$params) : static
Parameters
- $unit : string
- $params : array<int, mixed>
Tags
Return values
static —endOfCentury()
Resets the date to end of the century and time to 23:59:59.999999
public
endOfCentury() : static
Tags
Return values
static —endOfDay()
Resets the time to 23:59:59.999999 end of day
public
endOfDay() : static
Tags
Return values
static —endOfDecade()
Resets the date to end of the decade and time to 23:59:59.999999
public
endOfDecade() : static
Tags
Return values
static —endOfHour()
Modify to end of current hour, minutes and seconds become 59
public
endOfHour() : static
Tags
Return values
static —endOfMillennium()
Resets the date to end of the millennium and time to 23:59:59.999999
public
endOfMillennium() : static
Tags
Return values
static —endOfMinute()
Modify to end of current minute, seconds become 59
public
endOfMinute() : static
Tags
Return values
static —endOfMonth()
Resets the date to end of the month and time to 23:59:59.999999
public
endOfMonth() : static
Tags
Return values
static —endOfQuarter()
Resets the date to end of the quarter and time to 23:59:59.999999
public
endOfQuarter() : static
Tags
Return values
static —endOfSecond()
Modify to end of current second, microseconds become 999999
public
endOfSecond() : static
Tags
Return values
static —endOfWeek()
Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999
public
endOfWeek([int $weekEndsAt = null ]) : static
Parameters
- $weekEndsAt : int = null
-
optional start allow you to specify the day of week to use to end the week
Tags
Return values
static —endOfYear()
Resets the date to end of the year and time to 23:59:59.999999
public
endOfYear() : static
Tags
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(string $unit, array<int, mixed> ...$params) : static
Parameters
- $unit : string
- $params : array<int, mixed>
Tags
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
Return values
static —startOfDay()
Resets the time to 00:00:00 start of day
public
startOfDay() : static
Tags
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
Return values
static —startOfHour()
Modify to start of current hour, minutes and seconds become 0
public
startOfHour() : static
Tags
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
Return values
static —startOfMinute()
Modify to start of current minute, seconds become 0
public
startOfMinute() : static
Tags
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
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
Return values
static —startOfSecond()
Modify to start of current second, microseconds become 0
public
startOfSecond() : static
Tags
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([int $weekStartsAt = null ]) : static
Parameters
- $weekStartsAt : int = null
-
optional start allow you to specify the day of week to use to start the week
Tags
Return values
static —startOfYear()
Resets the date to the first day of the year and the time to 00:00:00
public
startOfYear() : static