DateHelper::daysInMonth

public static DateHelper::daysInMonth($date = NULL) Identifies the number of days in a month for a date. Parameters mixed $date: (optional) A DrupalDateTime object or a date string. Defaults to NULL, which means to use the current date. Return value int The number of days in the month. File core/lib/Drupal/Core/Datetime/DateHelper.php, line 456 Class DateHelper Defines Gregorian Calendar date values. Namespace Drupal\Core\Datetime Code public static function daysInMonth($date = NULL)

DateHelper::days

public static DateHelper::days($required = FALSE, $month = NULL, $year = NULL) Constructs an array of days in a month. Parameters bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE. int $month: (optional) The month in which to find the number of days. Defaults to NULL. int $year: (optional) The year in which to find the number of days. Defaults to NULL. Return value array An array of days for the selected month. File core/lib/Drupal/Core/Date

DateHelper::dayOfWeekName

public static DateHelper::dayOfWeekName($date = NULL, $abbr = TRUE) Returns translated name of the day of week for a given date. Parameters mixed $date: (optional) A DrupalDateTime object or a date string. Defaults to NULL, which means use the current date. string $abbr: (optional) Whether to return the abbreviated name for that day. Defaults to TRUE. Return value string The name of the day in the week for that date. File core/lib/Drupal/Core/Datetime/DateHelper.php, line 524 Class DateHe

DateHelper::dayOfWeek

public static DateHelper::dayOfWeek($date = NULL) Returns day of week for a given date (0 = Sunday). Parameters mixed $date: (optional) A DrupalDateTime object or a date string. Defaults to NULL, which means use the current date. Return value int The number of the day in the week. File core/lib/Drupal/Core/Datetime/DateHelper.php, line 501 Class DateHelper Defines Gregorian Calendar date values. Namespace Drupal\Core\Datetime Code public static function dayOfWeek($date = NULL) { if

DateHelper::ampm

public static DateHelper::ampm($required = FALSE) Constructs an array of AM and PM options. Parameters bool $required: (optional) If FALSE, the returned array will include a blank value. Defaults to FALSE. Return value array An array of AM and PM options. File core/lib/Drupal/Core/Datetime/DateHelper.php, line 437 Class DateHelper Defines Gregorian Calendar date values. Namespace Drupal\Core\Datetime Code public static function ampm($required = FALSE) { $none = array('' => '');

DateHelper

Defines Gregorian Calendar date values. Lots of helpful functions for use in massaging dates, specific to the Gregorian calendar system. The values include both translated and untranslated values. Untranslated values are useful as array keys and as css identifiers, and should be listed in English. Translated values are useful for display to the user. All values that need translation should be hard-coded and wrapped in t() so the translation system will be able to process them. Hierarchy class \

DateFormatterInterface::getSampleDateFormats

public DateFormatterInterface::getSampleDateFormats($langcode = NULL, $timestamp = NULL, $timezone = NULL) Provides values for all date formatting characters for a given timestamp. Parameters string|null $langcode: (optional) Language code of the date format, if different from the site default language. int|null $timestamp: (optional) The Unix timestamp to format, defaults to current time. string|null $timezone: (optional) The timezone to use, if different from the site's default timezone. Ret

DateFormatterInterface::formatTimeDiffUntil

public DateFormatterInterface::formatTimeDiffUntil($timestamp, $options = array()) Formats the time difference from the current request time to a timestamp. Parameters $timestamp: A UNIX timestamp to compare against the current request time. array $options: (optional) An associative array with additional options. The following keys can be used: granularity: An integer value that signals how many different units to display in the string. Defaults to 2. langcode: The language code for the lang

DateFormatterInterface::formatTimeDiffSince

public DateFormatterInterface::formatTimeDiffSince($timestamp, $options = array()) Formats the time difference from a timestamp to the current request time. Parameters $timestamp: A UNIX timestamp to compare against the current request time. array $options: (optional) An associative array with additional options. The following keys can be used: granularity: An integer value that signals how many different units to display in the string. Defaults to 2. langcode: The language code for the lang

DateFormatterInterface::formatInterval

public DateFormatterInterface::formatInterval($interval, $granularity = 2, $langcode = NULL) Formats a time interval with the requested granularity. Note that for intervals over 30 days, the output is approximate: a "month" is always exactly 30 days, and a "year" is always 365 days. It is not possible to make a more exact representation, given that there is only one input in seconds. If you are formatting an interval between two specific timestamps, use \Drupal\Core\Datetime\DateFormatter::form