DatePeriod::__construct

DatePeriod::__construct - Creates a new DatePeriod object
Manual
Code Examples

Description public DatePeriod::__construct DateTimeInterfacestart DateIntervalinterval intrecurrences intoptions0 public DatePeriod::__construct DateTimeInterfacestart DateIntervalinterval DateTimeInterfaceend intoptions0 public DatePeriod::__construct stringisostr intoptions0

Creates a new DatePeriod object.

Parameters

start

The start date of the period.

interval

The interval between recurrences within the period.

recurrences

The number of recurrences. Must be greater than 0.

end

The end date of the period.

isostr

An ISO 8601 repeating interval specification. Zero occurrences (R0/) are not supported.

options

Can be set to DatePeriod::EXCLUDE_START_DATE to exclude the start date from the set of recurring dates within the period.

Notes

Unbound numbers of repetitions as specified by ISO 8601 section 4.5 "Recurring time interval" are not supported, i.e. neither passing "R/..." as isostr nor passing null as end would work.

Changelog

Version Description
7.2.19, 7.3.6, 7.4.0 recurrences must be greater than 0 now.

Example of DatePeriod::__construct

Show all examples for DatePeriod::__construct

PHP Version:


Function DatePeriod::__construct:

Date and Time Functions

Most used PHP functions