ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
Days.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel
;
4
5
use
DateTimeInterface
;
6
use
PhpOffice\PhpSpreadsheet\Calculation\Exception
;
7
use
PhpOffice\PhpSpreadsheet\Calculation\Functions
;
8
use
PhpOffice\PhpSpreadsheet\Shared\Date
as
SharedDateHelper
;
9
10
class
Days
11
{
27
public
static
function
between
($endDate, $startDate)
28
{
29
try
{
30
$startDate =
Helpers::getDateValue
($startDate);
31
$endDate =
Helpers::getDateValue
($endDate);
32
}
catch
(
Exception
$e) {
33
return
$e->getMessage();
34
}
35
36
// Execute function
37
$PHPStartDateObject = SharedDateHelper::excelToDateTimeObject($startDate);
38
$PHPEndDateObject = SharedDateHelper::excelToDateTimeObject($endDate);
39
40
$days =
Functions::VALUE
();
41
$diff = $PHPStartDateObject->diff($PHPEndDateObject);
42
if
($diff !==
false
&& !is_bool($diff->days)) {
43
$days = $diff->days;
44
if
($diff->invert) {
45
$days = -$days;
46
}
47
}
48
49
return
$days;
50
}
51
}
PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel
Definition:
Constants.php:3
Date
DateTimeInterface
Exception
PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Helpers\getDateValue
static getDateValue($dateValue, bool $allowBool=true)
getDateValue.
Definition:
Helpers.php:31
PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Days\between
static between($endDate, $startDate)
DAYS.
Definition:
Days.php:27
Functions
php
PhpOffice\PhpSpreadsheet\Calculation\Functions\VALUE
static VALUE()
VALUE.
Definition:
Functions.php:229
PhpOffice\PhpSpreadsheet\Calculation\DateTimeExcel\Days
Definition:
Days.php:10
Exception
libs
composer
vendor
phpoffice
phpspreadsheet
src
PhpSpreadsheet
Calculation
DateTimeExcel
Days.php
Generated on Thu Feb 27 2025 19:01:23 for ILIAS by
1.8.13 (using
Doxyfile
)