Skip to content
Snippets Groups Projects

Ptps|function 7

Merged Александр Плохих requested to merge PTPS|Function_7 into main
2 unresolved threads
Files
3
+ 21
0
<?php
namespace App\Actions;
use DateTimeImmutable;
class DiffDaysAction
{
/**
* Вернет кол-во дней между датами
* @param DateTimeImmutable $dateStart дата начала
* @param DateTimeImmutable $dateEnd дата окончания
* @return int
* */
public static function count(
DateTimeImmutable $dateStart,
DateTimeImmutable $dateEnd
): int {
return (int) $dateStart->diff($dateEnd)->format('%a');
}
}
Loading