Buni.aiDocs
USSDChatbotVoice (IVR)Automation

Date & Time

Gets the current time, formats and parses dates, adds or subtracts durations, computes differences and finds the start or end of a period.

Date & Time does one date operation and saves the result in state. Pick an operation, point it at a date, and read the answer from {{state.dateResult}}.

When to use it

  • Stamp the current time on a record before saving it.
  • Work out a due date: today plus 14 days.
  • Count the days until an appointment, or since a last payment.
  • Turn a stored timestamp into something readable, such as 2026-09-24 14:30.
  • For anything these operations cannot express (time zones, weekday names, business days), use a Function node.

Not for USSD projects

Date & Time appears in the USSD palette, but the USSD runtime has no implementation for it, so a USSD flow that reaches it fails. Use a Function node on USSD.

Date & Time settings with Operation Add duration, Source date expression state.createdAt, Amount 14, Unit day

Settings

The fields shown depend on the operation.

Prop

Type

The generic Output section below these fields is not used; the result always goes to the variable in Output variable above.

Operations and results

OperationResult in {{state.dateResult}}
Get current time (now)The current time as an ISO timestamp, for example 2026-09-24T14:30:00.000Z.
Format dateThe source date as text in your format, for example 2026-09-24 14:30:00.
Parse string to dateThe source date as an ISO timestamp.
Add duration / Subtract durationThe shifted date as an ISO timestamp.
Difference between datesA whole number: source date minus second date, in the chosen unit. Positive when the source date is later.
Start of unit / End of unitThe first or last moment of that day, week, month, year, hour or minute, as an ISO timestamp. Weeks run Sunday to Saturday.

Example

A chatbot tells a customer when their subscription renews:

  1. Data Store GET loads the subscription as subscription.
  2. Date & Time, Add duration, source state.subscription.startedAt, amount 30, unit day, output renewsOn.
  3. Date & Time, Format date, source state.renewsOn, format DD/MM/YYYY, output renewsOnText.
  4. Reply: "Your plan renews on {{state.renewsOnText}}."

Tips and limits

  • Times are in UTC. The runtimes' clocks are UTC, so now, Format date and Start of day work in UTC, not your local or project time zone. Shift by hours with Add duration first if you need local time.
  • Each format token is replaced once. DD/MM/YYYY works; a format that repeats a token only fills the first.
  • Month and year are fixed lengths on chatbot and automation projects: 30 and 365 days. Adding 1 month to 31 January lands on 2 March. Voice projects move the calendar month instead.
  • The date fields take an expression on chatbot and automation projects (state.createdAt, not {{state.createdAt}}), and a template on voice projects ({{state.createdAt}}). On voice, a bare state.createdAt is read as text and the node falls back to the current time.
  • An unreadable date makes the node fail on chatbot and automation projects (Format date instead puts NaN where each number should be). On voice projects it falls back to the current time.
  • On voice projects, now returns the time in the Format string (so a caller can hear it), Start of unit and End of unit always use the day whatever unit you pick, and the difference is rounded rather than rounded down.
Last reviewed 24 September 2026

On this page