Extract Date Part
Pull the year, month, hour or weekday out of a date, as a number.
What it does
A date column holds one full timestamp per row. Extract Date Part takes one piece of it. The result is a plain number. Numbers group and chart well, so this step often comes before a group or a pivot.
Extract a part
- Type extract date in the Search transforms box, in the Pipeline panel.
- Select Extract Date Part in the results list.
- Under Select column, click the box and pick your date column.
- Open Date part. It reads Choose... at first.
- Select the part you want, such as hour.
- Type a name in New Column Name.
- Click Apply.
Example: a server log has an event_time column. Extract hour into a column named event_hour. You can now count events per hour of the day.
The parts you can pick
- year, for example 2026.
- month, from 1 to 12.
- day, the day of the month.
- hour, minute and second, from the time part of the value.
- dow, the day of the week as a number.
- week, the week number inside the year.
Where the number goes
The Apply results into section has two buttons. New Column (Number) is selected for you. Type your column name in the box below it. The name must not match a column you already have.
Select Existing Column to write over a column instead. A dropdown then lists every column in the table. Pick the one to overwrite.
Notes
- The column picker lists date columns only. Other columns do not appear.
- With no date column in the table, the panel says so. Convert a text column to a date first.
- With exactly one date column, the picker fills itself in for you.
- Leave New Column Name empty and the column is named after the source, such as event_time_hour.
For SQL users
The result is cast to a whole number. Extracting the hour runs as:
SELECT *, EXTRACT(hour FROM "event_time")::INTEGER AS "event_hour" FROM data
Try Extract Date Part with sample data →
Related Operations
- Increment Date - Add/subtract time intervals
- Date Difference - Calculate difference between two dates