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

节点 / builtin / datatransformation / datetime

Round a Date

Round a date up or down to a chosen unit of time

数据 扩展程序网页应用

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

Snap a date to the start or the end of a year, month, week, day, hour or minute.

Round a Date reads Date to round and moves it to a boundary of the chosen Unit:

  • Direction down gives the start of the unit. 2026-03-05 14:37 rounded down to day is 2026-03-05 00:00:00.
  • Direction up gives the very end of the unit. Rounded up to day it is 2026-03-05 23:59:59.999; up to month it is the last millisecond of 31 March.

Boundaries follow your computer’s local time zone. Weeks start on Sunday.

  • Get “start of today” or “start of this month” to filter recent items.
  • Compute the end of a billing or reporting period.
  • Group events by day or hour so timestamps in the same period match.
设置项类型作用
Date to round (必填)Date and timeThe date to round.
Unit (必填)ChoiceThe unit to round the date to. Options: year, month, week, day, hour, minute.
Direction (必填)ChoiceRound down (start of the unit) or up (end of the unit). Options: down, up.
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 round accepts a picked date or an expression such as {{ $input.createdAt }}.

  • Output

The item holds the rounded 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.

Build a “this month” date range for an API call:

  1. Get Current Date, Output field name now.
  2. Round a Date, Date to round {{ $input.now }}, Unit month, Direction down, Output field name from, Include input fields on.
  3. Round a Date, Date to round {{ $input.now }}, Unit month, Direction up, Output field name to, Include input fields on.
  4. Http Request with query params from = {{ $input.from }} and to = {{ $input.to }}.
  • The week starts on the wrong day. Weeks start on Sunday. To start on Monday, round down to week and then Add To A Date 1 day (careful on Sundays).
  • The result is a few hours off. The rounding happens in your local time zone, and the date is shown in UTC. Format it with Format Date to see local time.
  • The output is empty or “Invalid Date”. The input is not a readable date. Use an ISO date such as 2026-03-05T14:37:00.
编辑此页

最近更新:

Was this page useful?
向 Aria 询问“Round a Date”