function date_day_of_week_name in Date 7
Same name and namespace in other branches
- 5.2 date_api.module \date_day_of_week_name()
- 6.2 date_api.module \date_day_of_week_name()
- 6 date_api.module \date_day_of_week_name()
- 7.3 date_api/date_api.module \date_day_of_week_name()
- 7.2 date_api/date_api.module \date_day_of_week_name()
Returns translated name of the day of week for a given date.
Parameters
mixed $date: a date, default is current local day
string $abbr: Whether to return the abbreviated name for that day
Return value
the name of the day in the week for that date
1 call to date_day_of_week_name()
File
- date_api/
date_api.module, line 1413 - This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.
Code
function date_day_of_week_name($date = NULL, $abbr = TRUE) {
if (!is_object($date)) {
$date = new DateObject($date);
}
$dow = date_day_of_week($date);
$days = $abbr ? date_week_days_abbr() : date_week_days();
return $days[$dow];
}