DateTimeRange
in package
Data structure to handle DateTimw range
Table of Contents
Constants
- dateFormat = 'Y-m-d'
- dateTimeFormat = 'Y-m-d\TH:i:s'
- iso8601Format = 'c'
Properties
Methods
- __construct() : mixed
- endDate() : string
- Get end date
- endDateTime() : string
- Get end date time
- endISO8601() : string
- Get end date time
- startDate() : string
- Get start date
- startDateTime() : string
- Get start date time
- startISO8601() : string
- Get start date time
Constants
dateFormat
public
mixed
dateFormat
= 'Y-m-d'
dateTimeFormat
public
mixed
dateTimeFormat
= 'Y-m-d\TH:i:s'
iso8601Format
public
mixed
iso8601Format
= 'c'
Properties
$end
private
DateTime
$end
$start
private
DateTime
$start
Methods
__construct()
public
__construct(DateTime $start, DateTime $end) : mixed
Parameters
- $start : DateTime
- $end : DateTime
endDate()
Get end date
public
endDate() : string
Return values
string —End date in format YYYY-mm-dd'
endDateTime()
Get end date time
public
endDateTime() : string
Return values
string —End date time in format YYYY-mm-ddTHH:mm:ss'
endISO8601()
Get end date time
public
endISO8601() : string
Return values
string —End date time in format ISO 8601 (see: https://www.php.net/manual/it/datetime.format.php )
startDate()
Get start date
public
startDate() : string
Return values
string —Start date in format YYYY-mm-dd'
startDateTime()
Get start date time
public
startDateTime() : string
Return values
string —Start date time in format YYYY-mm-ddTHH:mm:ss'
startISO8601()
Get start date time
public
startISO8601() : string
Return values
string —Start date time in format ISO 8601 (see: https://www.php.net/manual/it/datetime.format.php )