1 date.inc date_days_in_year($date = NULL)

Identifies the number of days in a year for a date.

Parameters

mixed $date: (optional) The current date object, or a date string. Defaults to NULL.

Return value

int: The number of days in the year.

File

core/includes/date.inc, line 837
Date API functions.

Code

function date_days_in_year($date = NULL) {
  if (empty($date)) {
    $date = date_now();
  }
  elseif (!is_object($date)) {
    $date = new BackdropDateTime($date);
  }
  if (is_object($date)) {
    if ($date->format('L')) {
      return 366;
    }
    else {
      return 365;
    }
  }
  return NULL;
}