You are here

public function Carbon::startOfDecade in Persian Date for Drupal 8 8.4

Resets the date to the first day of the decade and the time to 00:00:00

Return value

static

File

src/Library/Carbon/Carbon.php, line 2965

Class

Carbon
A simple API extension for DateTime

Namespace

Drupal\persian_date\Library\Carbon

Code

public function startOfDecade() {
  $year = $this->year - $this->year % static::YEARS_PER_DECADE;
  return $this
    ->setDateTime($year, 1, 1, 0, 0, 0);
}