nœuds / builtin / datatransformation / datetime
Round a Date
Round a date up or down to a chosen unit of time
Ce contenu n’est pas encore disponible dans votre langue.
Snap a date to the start or the end of a year, month, week, day, hour or minute.
What it does
Section titled “What it does”Round a Date reads Date to round and moves it to a boundary of the chosen Unit:
- Direction
downgives the start of the unit.2026-03-05 14:37rounded down todayis2026-03-05 00:00:00. - Direction
upgives the very end of the unit. Rounded up todayit is2026-03-05 23:59:59.999; up tomonthit is the last millisecond of 31 March.
Boundaries follow your computer’s local time zone. Weeks start on Sunday.
When to use it
Section titled “When to use it”- 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.
Inputs and settings
Section titled “Inputs and settings”| Réglage | Type | Ce que cela fait |
|---|---|---|
| Date to round (obligatoire) | Date and time | The date to round. |
| Unit (obligatoire) | Choice | The unit to round the date to. Options: year, month, week, day, hour, minute. |
| Direction (obligatoire) | Choice | Round down (start of the unit) or up (end of the unit). Options: down, up. |
| Output field name (obligatoire) | 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. Par défaut : Off |
Date to round accepts a picked date or an expression such as {{ $input.createdAt }}.
Outputs
Section titled “Outputs”-
Output
The item holds the rounded date under Output field name. Turn on Include input fields to keep the incoming fields next to it.
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”Build a “this month” date range for an API call:
- Get Current Date, Output field name
now. - Round a Date, Date to round
{{ $input.now }}, Unitmonth, Directiondown, Output field namefrom, Include input fields on. - Round a Date, Date to round
{{ $input.now }}, Unitmonth, Directionup, Output field nameto, Include input fields on. - Http Request with query params
from={{ $input.from }}andto={{ $input.to }}.
Common issues
Section titled “Common issues”- The week starts on the wrong day. Weeks start on Sunday. To start on Monday, round down to
weekand 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.
Related nodes
Section titled “Related nodes”- Add To A Date: shift the rounded date.
- Format Date: turn it into text.
- Extract Part Of A Date: read a single part of a date.