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

节点 / builtin / datatransformation / datetime

Subtract From A Date

Subtract a number of days from a date

数据 扩展程序网页应用

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

Move a date back by a number of years, months, days, hours or other units.

Subtract From A Date takes Date to subtract from, removes Duration of the chosen Time unit to subtract, and writes the new date into a field named by Output field name.

  • Units: year, quarter (3 months), month, week (7 days), day, hour, minute, second.
  • The calculation uses your computer’s local time zone.
  • Going back a month from the 31st rolls over when the earlier month is shorter: 31 March minus 1 month gives 3 March (or 2 March in a leap year), not 28 February.
  • Build the start of a “last 7 days” or “last 24 hours” window.
  • Work out when a reminder should fire before a deadline.
  • Find a date one year ago for a comparison.
设置项类型作用
Date to subtract from (必填)Date and timeThe date to subtract days from.
Time unit to subtract (必填)ChoiceThe time unit to subtract from the date. Options: year, quarter, month, week, day, hour, minute, second.
Duration (必填)NumberThe duration to subtract from the date.
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 subtract from accepts a picked date or an expression such as {{ $input.deadline }}. ISO dates (2026-03-01, 2026-03-01T09:30:00Z) are the safest format.

  • Output

The item holds the new date under Output field name. Turn on Include input fields to keep the incoming fields next to it.

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

Keep only feed items from the last 24 hours:

  1. RSS Feed Read, URL of a news feed.
  2. Split Out, Field To Split Out items, Output field name article, so each article becomes its own item.
  3. Get Current Date, Output field name now, Include input fields on.
  4. Subtract From A Date, Date to subtract from {{ $input.now }}, Time unit to subtract day, Duration 1, Output field name since, Include input fields on.
  5. Filter: {{ $input.article.isoDate }} is after {{ $input.since }}, type Date-Time.
  • The output is “Invalid Date” or empty. The incoming value is not a date the browser understands. Use an ISO date such as 2026-03-01.
  • The month result lands in the wrong month. Subtracting months from the 29th to the 31st can roll forward into the next month. Round the date down to month first with Round a Date when you only care about the month.
  • The new date is missing after the node. With Include input fields on, an incoming field with the same name as Output field name replaces the result. Use a different name.
编辑此页

最近更新:

Was this page useful?
向 Aria 询问“Subtract From A Date”