ModifierTrait
Provides a suite of modifier methods.
These methods let you modify the various aspects of a DateTime with a series of fluent methods.
This trait expects that the implementing class also implements a copy() method. This method can be obtained using the CopyTrait.
Table of Contents
Properties
- $days : array<string|int, mixed>
- Names of days of the week.
- $weekEndsAt : int
- Last day of week
- $weekStartsAt : int
- First day of week
Methods
- addDay() : static
- Add a day to the instance
- addDays() : static
- Add days to the instance. Positive $value travels forward while negative $value travels into the past.
- addHour() : static
- Add an hour to the instance
- addHours() : static
- Add hours to the instance. Positive $value travels forward while negative $value travels into the past.
- addMinute() : static
- Add a minute to the instance
- addMinutes() : static
- Add minutes to the instance. Positive $value travels forward while negative $value travels into the past.
- addMonth() : static
- Add a month to the instance
- addMonths() : static
- Add months to the instance. Positive $value travels forward while negative $value travels into the past.
- addMonthsWithOverflow() : static
- Add months with overflowing to the instance. Positive $value travels forward while negative $value travels into the past.
- addMonthWithOverflow() : static
- Add a month with overflow to the instance.
- addSecond() : static
- Add a second to the instance
- addSeconds() : static
- Add seconds to the instance. Positive $value travels forward while negative $value travels into the past.
- addWeek() : static
- Add a week to the instance
- addWeekday() : static
- Add a weekday to the instance
- addWeekdays() : static
- Add weekdays to the instance. Positive $value travels forward while negative $value travels into the past.
- addWeeks() : static
- Add weeks to the instance. Positive $value travels forward while negative $value travels into the past.
- addYear() : static
- Add a year to the instance.
- addYears() : static
- Add years to the instance. Positive $value travel forward while negative $value travel into the past.
- addYearsWithOverflow() : static
- Add years with overflowing to the instance. Positive $value travels forward while negative $value travels into the past.
- addYearWithOverflow() : static
- Add a year with overflow to the instance.
- average() : static
- Modify the current instance to the average of a given instance (default now) and the current instance.
- day() : static
- Set the instance's day
- endOfCentury() : static
- Sets the date to end of the century and time to 23:59:59
- endOfDay() : static
- Sets the time to 23:59:59 or 23:59:59.999999 if `$microseconds` is true.
- endOfDecade() : static
- Sets the date to end of the decade and time to 23:59:59
- endOfMonth() : static
- Sets the date to end of the month and time to 23:59:59
- endOfWeek() : static
- Sets the date to end of week (defined in $weekEndsAt) and time to 23:59:59
- endOfYear() : static
- Sets the date to end of the year and time to 23:59:59
- firstOfMonth() : static
- Modify to the first occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the first day of the current month. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
- firstOfQuarter() : static
- Modify to the first occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the first day of the current quarter. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
- firstOfYear() : static
- Modify to the first occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the first day of the current year. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
- getWeekEndsAt() : int
- Get the last day of week
- getWeekStartsAt() : int
- Get the first day of week
- hour() : static
- Set the instance's hour
- lastOfMonth() : static
- Modify to the last occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the last day of the current month. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
- lastOfQuarter() : static
- Modify to the last occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the last day of the current quarter. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
- lastOfYear() : static
- Modify to the last occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the last day of the current year. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
- microsecond() : static
- Set the instance's microsecond
- minute() : static
- Set the instance's minute
- month() : static
- Set the instance's month
- next() : static
- Modify to the next occurrence of a given day of the week.
- nthOfMonth() : static|false
- Modify to the given occurrence of a given day of the week in the current month. If the calculated occurrence is outside the scope of the current month, then return false and no modifications are made.
- nthOfQuarter() : static|false
- Modify to the given occurrence of a given day of the week in the current quarter. If the calculated occurrence is outside the scope of the current quarter, then return false and no modifications are made.
- nthOfYear() : static|false
- Modify to the given occurrence of a given day of the week in the current year. If the calculated occurrence is outside the scope of the current year, then return false and no modifications are made.
- previous() : static
- Modify to the previous occurrence of a given day of the week.
- second() : static
- Set the instance's second
- setDate() : static
- Set the date to a different date.
- setDateTime() : static
- Set the date and time all together
- setTimeFromTimeString() : static
- Set the time by time string
- setWeekEndsAt() : void
- Set the last day of week
- setWeekStartsAt() : void
- Set the first day of week
- startOfCentury() : static
- Sets the date to the first day of the century and the time to 00:00:00
- startOfDay() : static
- Sets the time to 00:00:00
- startOfDecade() : static
- Sets the date to the first day of the decade and the time to 00:00:00
- startOfMonth() : static
- Sets the date to the first day of the month and the time to 00:00:00
- startOfWeek() : static
- Sets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
- startOfYear() : static
- Sets the date to the first day of the year and the time to 00:00:00
- subDay() : static
- Remove a day from the instance
- subDays() : static
- Remove days from the instance
- subHour() : static
- Remove an hour from the instance
- subHours() : static
- Remove hours from the instance
- subMinute() : static
- Remove a minute from the instance
- subMinutes() : static
- Remove minutes from the instance
- subMonth() : static
- Remove a month from the instance
- subMonths() : static
- Remove months from the instance
- subMonthsWithOverflow() : static
- Remove months with overflow from the instance.
- subMonthWithOverflow() : static
- Remove a month with overflow from the instance.
- subSecond() : static
- Remove a second from the instance
- subSeconds() : static
- Remove seconds from the instance
- subWeek() : static
- Remove a week from the instance
- subWeekday() : static
- Remove a weekday from the instance
- subWeekdays() : static
- Remove weekdays from the instance
- subWeeks() : static
- Remove weeks to the instance
- subYear() : static
- Remove a year from the instance
- subYears() : static
- Remove years from the instance.
- subYearsWithOverflow() : static
- Remove years with overflow from the instance
- subYearWithOverflow() : static
- Remove a year with overflow from the instance.
- timestamp() : static
- Set the instance's timestamp
- year() : static
- Set the instance's year
- setDateParent() : static
- Just calling to parent setDate It used in overwritten setDate
Properties
$days
Names of days of the week.
protected
static array<string|int, mixed>
$days
= [\Cake\Chronos\ChronosInterface::MONDAY => 'Monday', \Cake\Chronos\ChronosInterface::TUESDAY => 'Tuesday', \Cake\Chronos\ChronosInterface::WEDNESDAY => 'Wednesday', \Cake\Chronos\ChronosInterface::THURSDAY => 'Thursday', \Cake\Chronos\ChronosInterface::FRIDAY => 'Friday', \Cake\Chronos\ChronosInterface::SATURDAY => 'Saturday', \Cake\Chronos\ChronosInterface::SUNDAY => 'Sunday']
$weekEndsAt
Last day of week
protected
static int
$weekEndsAt
= \Cake\Chronos\ChronosInterface::SUNDAY
$weekStartsAt
First day of week
protected
static int
$weekStartsAt
= \Cake\Chronos\ChronosInterface::MONDAY
Methods
addDay()
Add a day to the instance
public
addDay([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of days to add.
Return values
staticaddDays()
Add days to the instance. Positive $value travels forward while negative $value travels into the past.
public
addDays(int $value) : static
Parameters
- $value : int
-
The number of days to add.
Return values
staticaddHour()
Add an hour to the instance
public
addHour([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of hours to add.
Return values
staticaddHours()
Add hours to the instance. Positive $value travels forward while negative $value travels into the past.
public
addHours(int $value) : static
Parameters
- $value : int
-
The number of hours to add.
Return values
staticaddMinute()
Add a minute to the instance
public
addMinute([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of minutes to add.
Return values
staticaddMinutes()
Add minutes to the instance. Positive $value travels forward while negative $value travels into the past.
public
addMinutes(int $value) : static
Parameters
- $value : int
-
The number of minutes to add.
Return values
staticaddMonth()
Add a month to the instance
public
addMonth([int $value = 1 ]) : static
Has the same behavior as addMonths()
.
Parameters
- $value : int = 1
-
The number of months to add.
Return values
staticaddMonths()
Add months to the instance. Positive $value travels forward while negative $value travels into the past.
public
addMonths(int $value) : static
When adding or subtracting months, if the resulting time is a date that does not exist, the result of this operation will always be the last day of the intended month.
Example:
(new Chronos('2015-01-03'))->addMonths(1); // Results in 2015-02-03
(new Chronos('2015-01-31'))->addMonths(1); // Results in 2015-02-28
Parameters
- $value : int
-
The number of months to add.
Return values
staticaddMonthsWithOverflow()
Add months with overflowing to the instance. Positive $value travels forward while negative $value travels into the past.
public
addMonthsWithOverflow(int $value) : static
If the new date does not exist, the days overflow into the next month.
Example:
(new Chronos('2012-01-30'))->addMonthsWithOverflow(1); // Results in 2013-03-01
Parameters
- $value : int
-
The number of months to add.
Return values
staticaddMonthWithOverflow()
Add a month with overflow to the instance.
public
addMonthWithOverflow([int $value = 1 ]) : static
Has the same behavior as addMonthsWithOverflow()
.
Parameters
- $value : int = 1
-
The number of months to add.
Return values
staticaddSecond()
Add a second to the instance
public
addSecond([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of seconds to add.
Return values
staticaddSeconds()
Add seconds to the instance. Positive $value travels forward while negative $value travels into the past.
public
addSeconds(int $value) : static
Parameters
- $value : int
-
The number of seconds to add.
Return values
staticaddWeek()
Add a week to the instance
public
addWeek([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of weeks to add.
Return values
staticaddWeekday()
Add a weekday to the instance
public
addWeekday([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of weekdays to add.
Return values
staticaddWeekdays()
Add weekdays to the instance. Positive $value travels forward while negative $value travels into the past.
public
addWeekdays(int $value) : static
Parameters
- $value : int
-
The number of weekdays to add.
Return values
staticaddWeeks()
Add weeks to the instance. Positive $value travels forward while negative $value travels into the past.
public
addWeeks(int $value) : static
Parameters
- $value : int
-
The number of weeks to add.
Return values
staticaddYear()
Add a year to the instance.
public
addYear([int $value = 1 ]) : static
Has the same behavior as addYears()
.
Parameters
- $value : int = 1
-
The number of years to add.
Return values
staticaddYears()
Add years to the instance. Positive $value travel forward while negative $value travel into the past.
public
addYears(int $value) : static
If the new date does not exist, the last day of the month is used instead instead of overflowing into the next month.
Example:
(new Chronos('2015-01-03'))->addYears(1); // Results in 2016-01-03
(new Chronos('2012-02-29'))->addYears(1); // Results in 2013-02-28
Parameters
- $value : int
-
The number of years to add.
Return values
staticaddYearsWithOverflow()
Add years with overflowing to the instance. Positive $value travels forward while negative $value travels into the past.
public
addYearsWithOverflow(int $value) : static
If the new date does not exist, the days overflow into the next month.
Example:
(new Chronos('2012-02-29'))->addYearsWithOverflow(1); // Results in 2013-03-01
Parameters
- $value : int
-
The number of years to add.
Return values
staticaddYearWithOverflow()
Add a year with overflow to the instance.
public
addYearWithOverflow([int $value = 1 ]) : static
Has the same behavior as addYearsWithOverflow()
.
Parameters
- $value : int = 1
-
The number of years to add.
Return values
staticaverage()
Modify the current instance to the average of a given instance (default now) and the current instance.
public
average([ChronosInterface|null $dt = null ]) : static
Parameters
- $dt : ChronosInterface|null = null
-
The instance to compare with.
Return values
staticday()
Set the instance's day
public
day(int $value) : static
Parameters
- $value : int
-
The day value.
Return values
staticendOfCentury()
Sets the date to end of the century and time to 23:59:59
public
endOfCentury() : static
Return values
staticendOfDay()
Sets the time to 23:59:59 or 23:59:59.999999 if `$microseconds` is true.
public
endOfDay([bool $microseconds = false ]) : static
Parameters
- $microseconds : bool = false
-
Whether to set microseconds
Return values
staticendOfDecade()
Sets the date to end of the decade and time to 23:59:59
public
endOfDecade() : static
Return values
staticendOfMonth()
Sets the date to end of the month and time to 23:59:59
public
endOfMonth() : static
Return values
staticendOfWeek()
Sets the date to end of week (defined in $weekEndsAt) and time to 23:59:59
public
endOfWeek() : static
Return values
staticendOfYear()
Sets the date to end of the year and time to 23:59:59
public
endOfYear() : static
Return values
staticfirstOfMonth()
Modify to the first occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the first day of the current month. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
public
firstOfMonth([int|null $dayOfWeek = null ]) : static
Parameters
- $dayOfWeek : int|null = null
-
The day of the week to move to.
Return values
staticfirstOfQuarter()
Modify to the first occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the first day of the current quarter. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
public
firstOfQuarter([int|null $dayOfWeek = null ]) : static
Parameters
- $dayOfWeek : int|null = null
-
The day of the week to move to.
Return values
staticfirstOfYear()
Modify to the first occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the first day of the current year. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
public
firstOfYear([int|null $dayOfWeek = null ]) : static
Parameters
- $dayOfWeek : int|null = null
-
The day of the week to move to.
Return values
staticgetWeekEndsAt()
Get the last day of week
public
static getWeekEndsAt() : int
Return values
intgetWeekStartsAt()
Get the first day of week
public
static getWeekStartsAt() : int
Return values
inthour()
Set the instance's hour
public
hour(int $value) : static
Parameters
- $value : int
-
The hour value.
Return values
staticlastOfMonth()
Modify to the last occurrence of a given day of the week in the current month. If no dayOfWeek is provided, modify to the last day of the current month. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
public
lastOfMonth([int|null $dayOfWeek = null ]) : static
Parameters
- $dayOfWeek : int|null = null
-
The day of the week to move to.
Return values
staticlastOfQuarter()
Modify to the last occurrence of a given day of the week in the current quarter. If no dayOfWeek is provided, modify to the last day of the current quarter. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
public
lastOfQuarter([int|null $dayOfWeek = null ]) : static
Parameters
- $dayOfWeek : int|null = null
-
The day of the week to move to.
Return values
staticlastOfYear()
Modify to the last occurrence of a given day of the week in the current year. If no dayOfWeek is provided, modify to the last day of the current year. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
public
lastOfYear([int|null $dayOfWeek = null ]) : static
Parameters
- $dayOfWeek : int|null = null
-
The day of the week to move to.
Return values
staticmicrosecond()
Set the instance's microsecond
public
microsecond(int $value) : static
Parameters
- $value : int
-
The microsecond value.
Return values
staticminute()
Set the instance's minute
public
minute(int $value) : static
Parameters
- $value : int
-
The minute value.
Return values
staticmonth()
Set the instance's month
public
month(int $value) : static
Parameters
- $value : int
-
The month value.
Return values
staticnext()
Modify to the next occurrence of a given day of the week.
public
next([int|null $dayOfWeek = null ]) : static
If no dayOfWeek is provided, modify to the next occurrence of the current day of the week. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
Parameters
- $dayOfWeek : int|null = null
-
The day of the week to move to.
Return values
staticnthOfMonth()
Modify to the given occurrence of a given day of the week in the current month. If the calculated occurrence is outside the scope of the current month, then return false and no modifications are made.
public
nthOfMonth(int $nth, int $dayOfWeek) : static|false
Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
Parameters
- $nth : int
-
The offset to use.
- $dayOfWeek : int
-
The day of the week to move to.
Return values
static|falsenthOfQuarter()
Modify to the given occurrence of a given day of the week in the current quarter. If the calculated occurrence is outside the scope of the current quarter, then return false and no modifications are made.
public
nthOfQuarter(int $nth, int $dayOfWeek) : static|false
Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
Parameters
- $nth : int
-
The offset to use.
- $dayOfWeek : int
-
The day of the week to move to.
Return values
static|falsenthOfYear()
Modify to the given occurrence of a given day of the week in the current year. If the calculated occurrence is outside the scope of the current year, then return false and no modifications are made.
public
nthOfYear(int $nth, int $dayOfWeek) : static|false
Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
Parameters
- $nth : int
-
The offset to use.
- $dayOfWeek : int
-
The day of the week to move to.
Return values
static|falseprevious()
Modify to the previous occurrence of a given day of the week.
public
previous([int|null $dayOfWeek = null ]) : static
If no dayOfWeek is provided, modify to the previous occurrence of the current day of the week. Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
Parameters
- $dayOfWeek : int|null = null
-
The day of the week to move to.
Return values
staticsecond()
Set the instance's second
public
second(int $value) : static
Parameters
- $value : int
-
The seconds value.
Return values
staticsetDate()
Set the date to a different date.
public
setDate(int $year, int $month, int $day) : static
Workaround for a PHP bug related to the first day of a month
Parameters
- $year : int
-
The year to set.
- $month : int
-
The month to set.
- $day : int
-
The day to set.
Attributes
- #[ReturnTypeWillChange]
Return values
staticsetDateTime()
Set the date and time all together
public
setDateTime(int $year, int $month, int $day, int $hour, int $minute[, int $second = 0 ]) : static
Parameters
- $year : int
-
The year to set.
- $month : int
-
The month to set.
- $day : int
-
The day to set.
- $hour : int
-
The hour to set.
- $minute : int
-
The minute to set.
- $second : int = 0
-
The second to set.
Return values
staticsetTimeFromTimeString()
Set the time by time string
public
setTimeFromTimeString(string $time) : static
Parameters
- $time : string
-
Time as string.
Return values
staticsetWeekEndsAt()
Set the last day of week
public
static setWeekEndsAt(int $day) : void
Parameters
- $day : int
-
The day the week ends with.
setWeekStartsAt()
Set the first day of week
public
static setWeekStartsAt(int $day) : void
Parameters
- $day : int
-
The day the week starts with.
startOfCentury()
Sets the date to the first day of the century and the time to 00:00:00
public
startOfCentury() : static
Return values
staticstartOfDay()
Sets the time to 00:00:00
public
startOfDay() : static
Return values
staticstartOfDecade()
Sets the date to the first day of the decade and the time to 00:00:00
public
startOfDecade() : static
Return values
staticstartOfMonth()
Sets the date to the first day of the month and the time to 00:00:00
public
startOfMonth() : static
Return values
staticstartOfWeek()
Sets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00
public
startOfWeek() : static
Return values
staticstartOfYear()
Sets the date to the first day of the year and the time to 00:00:00
public
startOfYear() : static
Return values
staticsubDay()
Remove a day from the instance
public
subDay([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of days to remove.
Return values
staticsubDays()
Remove days from the instance
public
subDays(int $value) : static
Parameters
- $value : int
-
The number of days to remove.
Return values
staticsubHour()
Remove an hour from the instance
public
subHour([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of hours to remove.
Return values
staticsubHours()
Remove hours from the instance
public
subHours(int $value) : static
Parameters
- $value : int
-
The number of hours to remove.
Return values
staticsubMinute()
Remove a minute from the instance
public
subMinute([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of minutes to remove.
Return values
staticsubMinutes()
Remove minutes from the instance
public
subMinutes(int $value) : static
Parameters
- $value : int
-
The number of minutes to remove.
Return values
staticsubMonth()
Remove a month from the instance
public
subMonth([int $value = 1 ]) : static
Has the same behavior as addMonths()
.
Parameters
- $value : int = 1
-
The number of months to remove.
Return values
staticsubMonths()
Remove months from the instance
public
subMonths(int $value) : static
Has the same behavior as addMonths()
.
Parameters
- $value : int
-
The number of months to remove.
Return values
staticsubMonthsWithOverflow()
Remove months with overflow from the instance.
public
subMonthsWithOverflow(int $value) : static
Has the same behavior as addMonthsWithOverflow()
.
Parameters
- $value : int
-
The number of months to remove.
Return values
staticsubMonthWithOverflow()
Remove a month with overflow from the instance.
public
subMonthWithOverflow([int $value = 1 ]) : static
Has the same behavior as addMonthsWithOverflow()
.
Parameters
- $value : int = 1
-
The number of months to remove.
Return values
staticsubSecond()
Remove a second from the instance
public
subSecond([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of seconds to remove.
Return values
staticsubSeconds()
Remove seconds from the instance
public
subSeconds(int $value) : static
Parameters
- $value : int
-
The number of seconds to remove.
Return values
staticsubWeek()
Remove a week from the instance
public
subWeek([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of weeks to remove.
Return values
staticsubWeekday()
Remove a weekday from the instance
public
subWeekday([int $value = 1 ]) : static
Parameters
- $value : int = 1
-
The number of weekdays to remove.
Return values
staticsubWeekdays()
Remove weekdays from the instance
public
subWeekdays(int $value) : static
Parameters
- $value : int
-
The number of weekdays to remove.
Return values
staticsubWeeks()
Remove weeks to the instance
public
subWeeks(int $value) : static
Parameters
- $value : int
-
The number of weeks to remove.
Return values
staticsubYear()
Remove a year from the instance
public
subYear([int $value = 1 ]) : static
Has the same behavior as addYears()
.
Parameters
- $value : int = 1
-
The number of years to remove.
Return values
staticsubYears()
Remove years from the instance.
public
subYears(int $value) : static
Has the same behavior as addYears()
.
Parameters
- $value : int
-
The number of years to remove.
Return values
staticsubYearsWithOverflow()
Remove years with overflow from the instance
public
subYearsWithOverflow(int $value) : static
Has the same behavior as addYeasrWithOverflow()
.
Parameters
- $value : int
-
The number of years to remove.
Return values
staticsubYearWithOverflow()
Remove a year with overflow from the instance.
public
subYearWithOverflow([int $value = 1 ]) : static
Has the same behavior as addYearsWithOverflow()
.
Parameters
- $value : int = 1
-
The number of years to remove.
Return values
statictimestamp()
Set the instance's timestamp
public
timestamp(int $value) : static
Parameters
- $value : int
-
The timestamp value to set.
Return values
staticyear()
Set the instance's year
public
year(int $value) : static
Parameters
- $value : int
-
The year value.
Return values
staticsetDateParent()
Just calling to parent setDate It used in overwritten setDate
private
setDateParent(int $year, int $month, int $day) : static
Parameters
- $year : int
-
The year to set.
- $month : int
-
The month to set.
- $day : int
-
The day to set.