DateRange

Class for date range

package

DateRange

subpackage

Utility

Methods

Constructor

__construct(\DateTime|string|integer $start, \DateTime|string|integer $end = null) 
throws

Arguments

$start

\DateTime|string|integer

Start date

$end

\DateTime|string|integer

End date

Returns end date object

end() : \DateTime

Response

\DateTime

Return formatted end date

endFormat(string $format) : string

Arguments

$format

string

Date format

Response

string

Returns true if $Date belongs to this range

isContains(\DateTime $Date, boolean $inclusive = true) 

Arguments

$Date

\DateTime

Checked date

$inclusive

boolean

True means include range edges

CreateIterator for given interval $time

period(string $time) : \ArrayIterator

Arguments

$time

string

Response

\ArrayIterator

Returns start date object

start() : \DateTime

Response

\DateTime

Return formatted start date

startFormat(string $format) : string

Arguments

$format

string

Date format

Response

string

Properties

Start date

_startDate : \DateTime
var

Type(s)

\DateTime

End date

_endDate : \DateTime
var

Type(s)

\DateTime