Date API functions.

File

core/includes/date.inc

Functions

Namesort ascending Description
date_years Constructs an array of years.
date_week_range Calculates the start and end dates for a calendar week.
date_week_days_untranslated Constructs an untranslated array of week days.
date_week_days_ordered Reorders weekdays to match the first day of the week.
date_week_days_abbr Constructs a translated array of week day abbreviations.
date_week_days Returns a translated array of week names.
date_weeks_in_year The number of calendar weeks in a year.
date_week The calendar week number for a date.
date_type_format Helper function for getting the format string for a date type.
date_timezone_names Returns a translated array of timezone names.
date_timezone_is_valid Determines if a timezone string is valid.
date_timezone_abbr Returns an array of system-allowed timezone abbreviations.
date_seconds Constructs an array of seconds.
date_range_years Splits a string like -3:+3 or 2001:2010 into an array of start and end years.
date_range_valid Tests validity of a date range string.
date_range_string Converts a min and max year into a string like '-3:+1'.
date_part_format Helper function to get a format for a specific part of a date field.
date_pad Helper function to left pad date parts with zeros.
date_now A date object for the current time.
date_nongranularity Strips out unwanted granularity elements.
date_month_names_untranslated Constructs an untranslated array of month names.
date_month_names_abbr Constructs a translated array of month name abbreviations.
date_month_names Returns a translated array of month names.
date_minutes Constructs an array of minutes.
date_make_iso_valid Replace specific ISO values using patterns.
date_limit_format Limits a date format to include only elements from a given granularity array.
date_is_date Determines if a date object is valid.
date_is_all_day Determine if a start/end date combination qualify as 'All day'.
date_iso_week_range Calculates the start and end dates for an ISO week.
date_iso_weeks_in_year Identifies the number of ISO weeks in a year for a date.
date_increment_round Helper function to round minutes and seconds to requested value.
date_hours Constructs an array of hours.
date_has_time Determines if the granularity contains a time portion.
date_has_date Determines if the granularity contains a date portion.
date_granularity_sorted Sorts a granularity array.
date_granularity_precision Give a granularity array, return the highest precision.
date_granularity_names Constructs an array of granularity options and their labels.
date_granularity_array_from_precision Constructs an array of granularity based on a given precision.
date_get_timezone_db Function to figure out which DB timezone applies to a date.
date_get_timezone Function to figure out which local timezone applies to a date and select it.
date_format_patterns Constructs an array of regex replacement strings for date format elements.
date_format_order Converts a format to an ordered array of granularity parts.
date_format_interval Formats a time interval with granularity, including past and future context.
date_format_date Formats a date, using a date type or a custom date format string.
date_default_timezone_object Returns a timezone object for the default timezone.
date_default_timezone Returns a timezone name to use as a default.
date_day_of_week_name Returns translated name of the day of week for a given date.
date_day_of_week Returns day of week for a given date (0 = Sunday).
date_days_in_year Identifies the number of days in a year for a date.
date_days_in_month Identifies the number of days in a month for a date.
date_days Constructs an array of days in a month.
date_ampm Constructs an array of AM and PM options.

Constants