跳转到内容
Agentic Workflowdocs
v0.8.2免费安装

节点 / builtin / datatransformation / datetime

Extract Part Of A Date

Extract a part of a date

数据 扩展程序网页应用

此内容尚不支持你的语言。

Pull one number out of a date, such as its year, day of the month or hour.

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.
  • 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.

设置项类型作用
Date to extract part from (必填)Date and timeThe date to extract part from.
Part of date to extract (必填)ChoiceThe 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 (必填)TextThe name of the output field.
Options GroupThe options for the node.
Options › Include input fields ToggleWhether to include the input fields in the output. 默认值: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.

  • 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.

None. This node needs no connection and has no slots for other nodes.

Only send a notification during working hours:

  1. Get Current Date, Output field name now.
  2. Extract Part Of A Date, Date to extract part from {{ $input.now }}, Part of date to extract hour, Output field name hour.
  3. IF: {{ $input.hour }} is greater than or equal to 9 and less than 18.
  4. On the true branch, a Browser Notification.
  • 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 as 2026-03-01.
  • 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.
编辑此页

最近更新:

Was this page useful?
向 Aria 询问“Extract Part Of A Date”