Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

date_api.module

Version

1.64.2.5.2.5 (checked in on 2008/06/11 at 11:15:52 by karens)

Description

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.

Constants

Namesort iconDescription
DATE_ARRAY
DATE_DATETIME
DATE_FORMAT_DATETIME
DATE_FORMAT_ICAL
DATE_FORMAT_ISO
DATE_FORMAT_UNIX
DATE_ICAL
DATE_ISOSet up some constants.
DATE_OBJECT
DATE_REGEX_DATETIME
DATE_REGEX_ICAL_DATE
DATE_REGEX_ICAL_DATETIME
DATE_REGEX_ISO
DATE_REGEX_LOOSE
DATE_UNIX

Functions

Namesort iconDescription
date_ampmAn array of am and pm options.
date_api_elementsImplementation of hook_elements().
date_api_initImplementation of hook_init().
date_api_set_db_timezoneWrapper around date handler setting for timezone.
date_api_simpletestImplementation of hook_simpletest().
date_api_theme
date_api_views_fetch_fieldsWrapper function to make sure this function will always work.
date_arrayCreate an array of values from a date object. Structured like the results of getdate() but not limited to the 32-bit signed range.
date_convertDate conversion helper function.
date_daysAn array of days.
date_days_in_monthIdentify the number of days in a month for a date.
date_days_in_yearIdentify the number of days in a year for a date.
date_day_of_weekReturns day of week for a given date (0 = Sunday).
date_day_of_week_nameReturns translated name of the day of week for a given date.
date_default_timezoneA timezone object for the default timezone.
date_default_timezone_nameReturn a timezone name to use as a default.
date_differenceCompute difference between two days using a given measure.
date_format_dateReworked from Drupal's format_date function to handle pre-1970 and post-2038 dates and accept a date object instead of a timestamp as input.
date_format_intervalAn override for interval formatting that adds past and future context
date_format_orderConvert a format to an ordered array of granularity parts.
date_format_patternsArray of regex replacement strings for date format elements. Used to allow input in custom formats. Based on work done for the Date module by Yves Chedemois (yched).
date_fuzzy_datetimeCreate valid datetime value from incomplete ISO dates or arrays.
date_granularity_namesArray of granularity options and their labels
date_has_timeFunction to figure out if any time data is to be collected or displayed.
date_hoursAn array of hours.
date_iso_arrayCreate an array of date parts from an ISO date.
date_iso_weeks_in_yearIdentify the number of ISO weeks in a year for a date.
date_is_validFunctions to test the validity of a date in various formats. Has special case for ISO dates and arrays which can be missing month and day and still be valid.
date_limit_formatRewrite a format string so it only inludes elements from a specified granularity array.
date_limit_valueRecalculate a date so it only includes elements from a granularity array. Helps prevent errors when unwanted values round up and ensures that unwanted date part values don't get stored in the database.
date_long_formatsAn array of long date formats.
date_make_dateConvert a date of any type or an array of date parts into a valid date object.
date_medium_formatsAn array of medium date formats.
date_minutesAn array of minutes.
date_month_namesA translated array of month names
date_month_names_abbrA translated array of month name abbreviations
date_month_names_untranslatedAn untranslated array of month names
date_nongranularityAn difference array of granularity elements that are NOT in the granularity array. Used by functions that strip unwanted granularity elements out of formats and values.
date_nowA date object for the current time.
date_padHelper function to left pad date parts with zeros. Provided because this is needed so often with dates.
date_part_extractExtract integer value of any date part from any type of date.
date_secondsAn array of seconds.
date_short_formatsAn array of short date formats.
date_tA version of the t() function for date parts that need translation.
date_timezone_abbrAn array of timezone abbreviations that the system allows. Cache an array of just the abbreviation names because the whole timezone_abbreviations_list is huge so we don't want to get it more than necessary.
date_timezone_namesA translated array of timezone names. Cache the untranslated array, make the translated array a static variable.
date_type_formatHelper function for getting the format string for a date type.
date_weekThe calendar week number for a date.
date_weeks_in_yearThe number of calendar weeks in a year.
date_week_daysA translated array of week days
date_week_days_abbrAn translated array of week day abbreviations.
date_week_days_orderedOrder weekdays Correct weekdays array so first day in array matches the first day of the week. Use to create things like calendar headers.
date_week_days_untranslatedAn untranslated array of week days
date_week_rangeStart and end dates for a calendar week, adjusted to use the chosen first day of week for this site.
date_yearsAn array of years.