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"?)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 documentation for more details on date and time format patterns.
Common patterns:
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, andyear.value— the amount of time to add (use a negative number to subtract).zoneId— (optional) the timezone of the input date. Defaults toUTC.
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
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, andmillisecond.
Notes:
If the difference between the two dates is less than 1 unit, the result will be
0.If
timestamp1is greater thantimestamp2, the function returns a negative value.
Input example
Application examples
Last updated
Was this helpful?