1 date.inc date_granularity_names()

Constructs an array of granularity options and their labels.

Return value

array: An array of translated date parts, keyed by their machine name.

File

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

Code

function date_granularity_names() {
  return array(
    'year' => t('Year', array(), array('context' => 'datetime')),
    'month' => t('Month', array(), array('context' => 'datetime')),
    'day' => t('Day', array(), array('context' => 'datetime')),
    'hour' => t('Hour', array(), array('context' => 'datetime')),
    'minute' => t('Minute', array(), array('context' => 'datetime')),
    'second' => t('Second', array(), array('context' => 'datetime')),
  );
}