name: op-feat-date-features
description: Expand a date or datetime field into year / month / day / day-of-week / quarter (+ hour) derived fields.
kind: operator
category: FEAT
operator: FEAT_DATE_FEATURES
type: reference
applies_to: process, compose, predict
examples_tags: [feature-engineering, time-series, pre-filter]
Feature operators write derived fields before filters run; no Response.Components.
Use when
Splits a date into year, month, day, day of week and quarter fields, so each part can be filtered, grouped or modelled.
Questions it answers:
- Do orders differ by day of the week?
- Is there a seasonal pattern by month across several years?
Use something else:
ATTR_DATE_PARTwhen you need just one part of the date.GROUP_DATEwhen you want results grouped by day, month or year.
Params
None; params is unused.
Inputs
field (required) — date or datetime.
Output
Derived fields prefixed by label (default the field name):
| Field | Range |
|---|---|
<prefix>_year | year |
<prefix>_month | 1..12 |
<prefix>_day | 1..31 |
<prefix>_dow | ISO 1..7, 1 = Monday, 7 = Sunday |
<prefix>_quarter | 1..4 |
<prefix>_hour | 0..23 — datetime only |
Contract
- Types (
field):date,datetime; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED. - Weight: not read; a weight in force is skipped.
- Streaming: streamable.
Gotchas
- Null source or
tz_fieldvalue → every outputnull. dowis ISO (6= Saturday,7= Sunday) of the LOCAL day; ignoresweek_start.- Local Saturdays out:
FILTER_EXCLUDEon<prefix>_dow["6"]; withtz_fieldeach row reads its own zone. - Suffixes are
dow/quarter(notday_of_week/is_weekend). - Zone-capable: a
datetimereads the LOCAL clock (slottz/tz_field→time_zone_field/time_zone→ cohort default field → default → UTC). Adateignores zones (explicit refused).
See
pulse_examples_search tags=[time-series],tags=[feature-engineering]- Skills:
feature-engineering,op-attr-date-part,request-envelope(Time zones)