knoten / builtin / datatransformation / datetime
Extract Part Of A Date
Extract a part of a date
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Pull one number out of a date, such as its year, day of the month or hour.
What it does
Section titled “What it does”Extract Part Of A Date reads Date to extract part from and returns one number, chosen with Part of date to extract, in the field named by Output field name. Values are read in your computer’s local time zone.
| Part | What you get |
|---|---|
| year | The full year, for example 2026. |
| month | The month counted from 0: January is 0, December is 11. |
| week | The day of the month divided by 7, a decimal (the 15th gives about 2.14). It is not a week-of-year number. |
| day | The day of the month, 1 to 31. |
| hour | 0 to 23. |
| minute, second | 0 to 59. |
When to use it
Section titled “When to use it”- Branch on the hour, for example only notify between 9 and 18 with IF.
- Group or label items by year.
- Check whether today is the 1st of the month.
To turn a date into readable text, use Format Date instead.
Inputs and settings
Section titled “Inputs and settings”| Einstellung | Typ | Was es bewirkt |
|---|---|---|
| Date to extract part from (erforderlich) | Date and time | The date to extract part from. |
| Part of date to extract (erforderlich) | Choice | The part of the date to extract. Month counts from 1 (January); week is the ISO week of the year. Options: year, month, week, day, hour, minute, second. |
| Output field name (erforderlich) | Text | The name of the output field. |
| Options | Group | The options for the node. |
| Options › Include input fields | Toggle | Whether to include the input fields in the output. Standard: Off |
Date to extract part from accepts a picked date or an expression such as {{ $input.publishedAt }}. ISO dates (2026-03-01T09:30:00Z) work best.
Outputs
Section titled “Outputs”-
Output
The item holds one number under Output field name, for example { hour: 14 }. Turn on Include input fields to keep the incoming fields too.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”Only send a notification during working hours:
- Get Current Date, Output field name
now. - Extract Part Of A Date, Date to extract part from
{{ $input.now }}, Part of date to extracthour, Output field namehour. - IF:
{{ $input.hour }}is greater than or equal to9and less than18. - On the true branch, a Browser Notification.
Common issues
Section titled “Common issues”- The month is one lower than expected. Months start at 0. Add 1 with Math, or use Format Date if you need it as text.
- “week” returns a decimal. It is the day of the month divided by 7, not the week of the year.
- The output is empty or
NaN. The incoming value is not a date the browser can read. Use an ISO date such as2026-03-01.
Related nodes
Section titled “Related nodes”- Format Date: turn a date into text.
- Round a Date: snap a date to the start or end of a unit.
- IF: branch on the extracted number.