You are here

public function BillingPeriod::getDuration in Commerce Recurring Framework 8

Gets the duration of the billing period, in seconds.

Return value

int The duration.

File

src/BillingPeriod.php, line 75

Class

BillingPeriod
Represents a single billing period.

Namespace

Drupal\commerce_recurring

Code

public function getDuration() {
  return $this->endDate
    ->format('U') - $this->startDate
    ->format('U');
}