DatePeriod (class)
The DatePeriod class
Introduction
(PHP 5 >= 5.3.0, PHP 7)
Represents a date period.
A date period allows iteration over a set of dates and times, recurring at regular intervals, over a given period.
Class synopsis
DatePeriod implements Traversable {
/* Constants */
/* Methods */
public __construct ( DateTimeInterface
$start
, DateInterval $interval
, int $recurrences
[, int $options
] ) public __construct ( DateTimeInterface
$start
, DateInterval $interval
, DateTimeInterface $end
[, int $options
] )public DateInterval getDateInterval ( void )
public DateTimeInterface getEndDate ( void )
public DateTimeInterface getStartDate ( void )}
Predefined Constants
DatePeriod::EXCLUDE_START_DATE
-
Exclude start date, used in DatePeriod::__construct().
Table of Contents
- DatePeriod::__construct — Creates a new DatePeriod object
- DatePeriod::getDateInterval — Gets the interval
- DatePeriod::getEndDate — Gets the end date
- DatePeriod::getStartDate — Gets the start date
© 1997–2017 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://secure.php.net/manual/en/class.dateperiod.php