The Date field

The Date field is provided by the Datetime module. It is enabled by default with the standard installation profile.

  1. The Date module has a setting that defines what kind of data it will be storing: date and time, or date only. This setting cannot be changed once the field data has been saved.
  2. Click on Save field settings to customize the field for this specific bundle.

 

  1. The Date field has two ways of providing a default value. It can either be the current date or a relative date using PHP's date time modifier syntax.
  2. By default, Date fields use the HTML5 date and time inputs, resulting in a native date and time picker provided by the browser.
  3. Additionally, Date fields can be configured to use a select list for each date and time component:
  1. The default date field formatter display uses Drupal's time formats to render the time format. These are configured under Configuration and Regional and language in the Date and time formats form.
  2. Dates and times can be displayed as Time ago to provide a semantic display of how far in the future or past a time is. The formats for both are customizable in the display settings.
  3. Finally, dates and times can be displayed using a custom format, as specified by the PHP date formats.