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-12-13 05:29:52 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)