function date_days_in_year in Date 7.3
Same name and namespace in other branches
- 5.2 date_api.module \date_days_in_year()
- 6.2 date_api.module \date_days_in_year()
- 6 date_api.module \date_days_in_year()
- 7 date_api/date_api.module \date_days_in_year()
- 7.2 date_api/date_api.module \date_days_in_year()
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.
2 calls to date_days_in_year()
- DateApiTestCase::testDateApi in date_api/
tests/ DateApiTestCase.test - Test date_format_date().
- DateObject::difference in date_api/
date_api.module - Computes difference between two days using a given measure.
File
- date_api/
date_api.module, line 2021 - This module will make the date API available to other modules.
Code
function date_days_in_year($date = NULL) {
if (empty($date)) {
$date = date_now();
}
elseif (!is_object($date)) {
$date = new DateObject($date);
}
if (is_object($date)) {
if ($date
->format('L')) {
return 366;
}
else {
return 365;
}
}
return NULL;
}