salamek/php-daterange

Php date range implementation, usualy used in PgSQL database

v1.0.1 2018-04-01 03:42 UTC

This package is auto-updated.

Last update: 2024-11-13 05:18:09 UTC


README

Php date range implementation, usualy used in PgSQL database

<?php

$dateRange = new Salamek\DateRange(\DateTimeInterface $startDate, \DateTimeInterface $endDate);

$dateRange->getStartDate(); //$startDate
$dateRange->getEndDate(); //$endDate
$datePeriod = $dateRange->datePeriod(\DateInterval $dateInterval); // same as \DatePeriod(\DateTimeInterface $startDate, \DateInterval $dateInterval, \DateTimeInterface $endDate)