Time & Date

The Time & Date integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides sensors for the current date or time in different formats. All values are based on the time zone configured under Settings > System > General.

Configuration

To add the Time & Date service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

  • Browse to your Home Assistant instance.

  • Go to Settings > Devices & services.

  • In the bottom right corner, select the Add Integration button.

  • From the list, select Time & Date.

  • Follow the instructions on screen to complete the setup.

During setup, select the display option for the sensor you want to create. The integration creates one sensor in the selected format.

Display option

The date or time format for the sensor. Available options:

  • Date: The current date, for example, 2026-04-12.
  • Date & Time: The current date and time, for example, 2026-04-12, 14:30.
  • Date & Time (ISO): The current date and time in ISO 8601 format, for example, 2026-04-12T14:30:00.
  • Date & Time (UTC): The current date and time in UTC, for example, 2026-04-12, 12:30.
  • Time: The current local time, for example, 14:30.
  • Time & Date: The current time and date (reversed order), for example, 14:30, 2026-04-12.
  • Time (UTC): The current time in UTC, for example, 12:30.

Data updates

Sensors that include the time update every minute. The date-only sensor updates each day at midnight.

Creating a custom time and date sensor

If you want a sensor with a custom date or time format, you can create a template sensor in your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file. The example below uses the sensor created by the Date & Time (ISO) display option as the source and reformats it with timestamp_custom() using standard Python datetime formatting.

Add the following to your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]: After changing the configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file, restart Home Assistant to apply the changes.

template:
  - sensor:
      - name: "Date and time"
        state: >
          {{
            as_timestamp(states('sensor.date_time_iso'))
            | timestamp_custom('%A %B %-d, %I:%M %p')
          }}
        icon: "mdi:calendar-clock"

This requires the Date & Time (ISO) display option to be set up in this integration.

More time-related resources

For more information about using time related variables and sensors in templates, see the template function reference for today_at, now, and as_timestamp.