concrete/src/Localization/Service/Date.php
public function getDeltaDays($from, $to, $timezone = 'user')
    {
        $dtFrom = $this->toDateTime($from, $timezone);
        $dtTo = $this->toDateTime($to, $timezone);
        if (is_null($dtFrom) || is_null($dtTo)) {
            return null;
        }

        // Re-create DateTime objects without time
        $dtFrom = $this->toDateTime($dtFrom->format('Y-m-d'), $timezone);
        $dtTo = $this->toDateTime($dtTo->format('Y-m-d'), $timezone);

        return (int) $dtFrom->diff($dtTo)->format('%r%a');
    }
public function getDeltaDays($from, $to, $timezone = 'user')
    {
        $dtFrom = $this->toDateTime($from, $timezone);
        $dtTo = $this->toDateTime($to, $timezone);
        if (is_null($dtFrom) || is_null($dtTo)) {
            return null;
        }

        // Re-create DateTime objects without time
        $dtFrom = $this->toDateTime($dtFrom->format('Y-m-d'), $timezone);
        $dtTo = $this->toDateTime($dtTo->format('Y-m-d'), $timezone);

        return (int) $dtFrom->diff($dtTo)->format('%r%a');
    }
public function getDeltaDays ( $ from , $ to , $ timezone = 'user' ) { $ dtFrom = $ this -> toDateTime ( $ from , $ timezone ) ; $ dtTo = $ this -> toDateTime ( $ to , $ timezone ) ; if ( is_null ( $ dtFrom ) || is_null ( $ dtTo ) ) { return null ; } // Re-create DateTime objects without time $ dtFrom = $ this -> toDateTime ( $ dtFrom -> format ( 'Y-m-d' ) , $ timezone ) ; $ dtTo = $ this -> toDateTime ( $ dtTo -> format ( 'Y-m-d' ) , $ timezone ) ; return ( int ) $ dtFrom -> diff ( $ dtTo ) -> format ( '%r%a' ) ; }
Returns the difference in days between to dates.

@param mixed $from The start date/time representation (one of the values accepted by toDateTime)
@param mixed $to The end date/time representation (one of the values accepted by toDateTime)
@param string $timezone The timezone to set. Special values are:<ul>
<li>'system' for the current system timezone</li>
<li>'user' (default) for the user's timezone</li>
<li>'app' for the app's timezone</li>
<li>Other values: one of the PHP supported time zones (see http://us1.php.net/manual/en/timezones.php )</li>
</ul>

@return int|null Returns the difference in days (less than zero if $dateFrom if greater than $dateTo).
Returns null if one of both the dates can't be parsed

@throws \Punic\Exception\BadArgumentType
Returns the difference in days between to dates .