Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Simple Time Field

225 sites No security coverage
View on drupal.org

This module provides a dedicated field type for storing and displaying time-of-day values, distinct from Drupal's full date and timezone handling. It allows for configuration of time intervals, offers flexible display formatting, and integrates with Feeds for importing various time string formats.

The Simple Time Field module provides a lightweight, dedicated time-of-day field type for any fieldable Drupal entity. Unlike Drupal core's date field, which bundles dates and timezones, this module focuses exclusively on the time component. It stores values in a standardized format (HH:MM or HH:MM:SS) and offers a wide range of configurable display options, making it the perfect solution for business hours, event schedules, and appointment slots.

Features

  • Pure Time Storage: Focuses strictly on time (00:00 to 23:59) without the overhead of date components or complex timezone conversions.
  • Native Browser Integration: Utilizes HTML5 time input elements for a seamless user experience, including support for min, max, and step attributes.
  • Flexible Granularity: Configure time intervals ranging from 1-second precision to 1-hour slots to match your specific use case.
  • Powerful Formatting: Ships with four formatters, including a highly configurable "Time (configurable format)" option that supports custom PHP date strings and display-only timezone shifting.
  • Feeds Integration: Automatically registers a Feeds target to normalize human-readable strings like "2pm" or "14:30" during imports.
  • Views Compatibility: Stored as a varchar string, allowing for reliable alphabetical sorting and filtering within Drupal Views.

Installation

The recommended installation method is via Composer to ensure all internal dependencies are correctly mapped.

composer require drupal/simple_time_field

Enable the module using Drush:

drush en simple_time_field
drush cr

Configuration Workflow

Setting up a time field is integrated directly into the standard Drupal Field UI:

  1. Add Field: Navigate to Structure » [Entity Type] » Manage fields and add a new field of type "Time".
  2. Storage Settings: Choose whether to Include seconds in the data storage.
  3. Manage Form Display: Click the gear icon on the field to set Minimum/Maximum time restrictions and the Time interval (step).
  4. Manage Display: Choose your preferred formatter (e.g., 12-hour AM/PM or 24-hour) and optional timezone offsets for output.

Feeds Integration

When the Feeds module is enabled, Simple Time Field provides a specialized mapper. It is designed to be "smart"—it attempts to parse arbitrary strings using strtotime(). This means you can import data from messy CSVs containing "2:30 PM" and have it correctly stored as "14:30" without manual pre-processing.

Additional Requirements

This module requires Drupal 9, 10, or 11. It has no mandatory external library dependencies. For import functionality, the Feeds module is recommended but optional.

Similar projects

  • Date (For full date/time stamps with timezone support)
  • Office Hours (Specifically tailored for weekly business opening slots)
  • Duration Field (For storing lengths of time rather than a specific time of day)

Supporting this Module

If you encounter bugs, require assistance with time pickers in specific browsers, or have feature suggestions, please use the official issue queue. We particularly welcome feedback on expanding the Feeds normalization logic or adding new preset formatters.

Activity

Total releases
4
First release
Jan 2025
Latest release
4 months ago
Releases (12 mo)
2
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.3.0 Stable Feb 20, 2026
1.3.x-dev Dev Feb 20, 2026
1.2.x-dev Dev Jan 28, 2025
1.2.1 Stable Jan 28, 2025