\duncan3dc\Dates\TraitsRelativeDateTimes

Get a new DateTime object relative to the current one.

Summary

Methods
Properties
Constants
addDays()
subDays()
prevDay()
nextDay()
addWeeks()
subWeeks()
addMonths()
subMonths()
prevMonth()
nextMonth()
addYears()
subYears()
prevYear()
nextYear()
addSeconds()
subSeconds()
addMinutes()
subMinutes()
addHours()
subHours()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

addDays()

addDays(integer  $days) : static

Get a DateTime object for the specified number of days difference.

Parameters

integer $days

The number of days to add

Returns

static

subDays()

subDays(integer  $days) : static

Get a DateTime object for the specified number of days difference.

Parameters

integer $days

The number of days to subtract

Returns

static

prevDay()

prevDay() : static

Get a DateTime object for the previous day.

Returns

static

nextDay()

nextDay() : static

Get a DateTime object for the next day.

Returns

static

addWeeks()

addWeeks(integer  $weeks) : static

Get a DateTime object for the specified number of weeks difference.

Parameters

integer $weeks

The number of weeks to add

Returns

static

subWeeks()

subWeeks(integer  $weeks) : static

Get a DateTime object for the specified number of weeks difference.

Parameters

integer $weeks

The number of weeks to subtract

Returns

static

addMonths()

addMonths(integer  $months) : static

Get a DateTime object for the specified number of months difference.

Parameters

integer $months

The number of months to add

Returns

static

subMonths()

subMonths(integer  $months) : static

Get a DateTime object for the specified number of months difference.

Parameters

integer $months

The number of months to subtract

Returns

static

prevMonth()

prevMonth() : static

Get a DateTime object for the previous month.

Returns

static

nextMonth()

nextMonth() : static

Get a DateTime object for the next month.

Returns

static

addYears()

addYears(integer  $years) : static

Get a DateTime object for the specified number of years difference.

Parameters

integer $years

The number of years to add

Returns

static

subYears()

subYears(integer  $years) : static

Get a DateTime object for the specified number of years difference.

Parameters

integer $years

The number of years to subtract

Returns

static

prevYear()

prevYear() : static

Get a DateTime object for the previous year.

Returns

static

nextYear()

nextYear() : static

Get a DateTime object for the next year.

Returns

static

addSeconds()

addSeconds(integer  $seconds) : static

Get a DateTime object for the specified number of seconds difference.

Parameters

integer $seconds

The number of seconds to add

Returns

static

subSeconds()

subSeconds(integer  $seconds) : static

Get a DateTime object for the specified number of seconds difference.

Parameters

integer $seconds

The number of seconds to subtract

Returns

static

addMinutes()

addMinutes(integer  $minutes) : static

Get a DateTime object for the specified number of minutes difference.

Parameters

integer $minutes

The number of minutes to add

Returns

static

subMinutes()

subMinutes(integer  $minutes) : static

Get a DateTime object for the specified number of minutes difference.

Parameters

integer $minutes

The number of minutes to subtract

Returns

static

addHours()

addHours(integer  $hours) : static

Get a DateTime object for the specified number of hours difference.

Parameters

integer $hours

The number of hours to add

Returns

static

subHours()

subHours(integer  $hours) : static

Get a DateTime object for the specified number of hours difference.

Parameters

integer $hours

The number of hours to subtract

Returns

static