Date functions

Learn about date functions in the Digibee Integration Platform and how to use them.

Date functions are used to process, generate, and convert dates. They are available for connectors that support Double Braces expressions. To learn how to provide information to connectors using this resource, refer to Double Braces Functions.

FORMATDATE

Using Double Braces, you can combine this function with access to the input JSON element of a connector.

FORMATDATE formats date and time values, with optional support for locale and timezone handling.

Syntax

FORMATDATE(value, "origin-format", "destination-format", "locale-origin"?, "timezone-origin"?, "locale-destination"?, "timezone-destination"?)
circle-info

Parameters marked with ? are optional and can be set to null.

Date format definition: dd/MM/yyyy. You can also use the keyword timestamp instead of a format string. The value will always be converted using ISO Zoned Date/Time.

Date and time format patterns

Refer to the Java DateTimeFormatter documentationarrow-up-right for more details on date and time format patterns.

Common patterns:

Pattern
Description

y

Year (year-of-era)

u

Year

M

Month of year

d

Day of month

E

Day of week (text)

e, c

Day of week (number)

D

Day of year (1–365)

H

Hour (0–23)

h

Hour (1–12)

a

AM/PM marker

m

Minutes

s

Seconds

Input example

Conversion examples

NOW

Using Double Braces, you can combine this function with access to the input JSON element of a connector.

NOW returns the current date and time as a timestamp in milliseconds.

Syntax

Usage examples

SUMDATE

Using Double Braces, you can combine this function with access to the input JSON element of a connector.

SUMDATE adds or subtracts a given amount of time from a date, based on a specified time unit.

Syntax

Parameters:

  • milliseconds — the input date as a Unix timestamp.

  • unit — the time unit to apply. Accepted values: hour, minute, second, day, month, and year.

  • value — the amount of time to add (use a negative number to subtract).

  • zoneId(optional) the timezone of the input date. Defaults to UTC.

chevron-rightAccepted timezoneshashtag
  • Australia/Darwin

  • Australia/Sydney

  • America/Argentina/Buenos_Aires

  • Africa/Cairo

  • America/Anchorage

  • America/Sao_Paulo

  • Asia/Dhaka

  • Africa/Harare

  • America/St_Johns

  • America/Chicago

  • Asia/Shanghai

  • Africa/Addis_Ababa

  • Europe/Paris

  • America/Indiana/Indianapolis

  • Asia/Kolkata

  • Asia/Tokyo

  • Pacific/Apia

  • Asia/Yerevan

  • Pacific/Auckland

  • Asia/Karachi

  • America/Phoenix

  • America/Puerto_Rico

  • America/Los_Angeles

  • Pacific/Guadalcanal

  • Asia/Ho_Chi_Minh

Example

To add 10 seconds to a timestamp:

Expected result:

TOISODATE

Using Double Braces, you can combine this function with access to the input JSON element of a connector.

TOISODATE converts a date and time value to ISO Date format, with optional locale and timezone support.

Syntax

circle-info

Parameters marked with ? are optional and can be set to null.

Date format definition: dd/MMMM/yyyy HH:mm:ss. You can also use the keyword timestamp instead of a format string. If no timezone is specified, UTC will be used by default.

Input example

Conversion examples

DIFFDATE

DIFFDATE calculates the difference between two dates.

Syntax

Parameters:

  • timestamp1, timestamp2 — both dates must be provided in timestamp format.

  • timeUnit — accepted values: year, month, day, hour, minute, second, and millisecond.

circle-info

The calculation is performed as: timestamp2 - timestamp1.

Notes:

  • If the difference between the two dates is less than 1 unit, the result will be 0.

  • If timestamp1 is greater than timestamp2, the function returns a negative value.

Input example

Application examples

Last updated

Was this helpful?