Show Menu

Data types

Technically, a constant always contains a data type. In the literal expression, we only specify the value. The data type can be inferred from the value (for example string, integer, decimal, etc.). For specific cases such as date time, we use dedicated functions for the representation.
Here is how data type expressions are represented:
Data Type Description Literal Representation Example
Common sequence of characters.
It doesn't have any specific size except the implicit one that comes from the environment such as the amount of memory available.
JSON format: String
Serialization format: UTF-8
"hello world"

'hello world'

Integer value from -2^63 to 2^63-1.
JSON format: Number
<integer value>

Decimal number.
It represents a floating value:
- largest positive finite value of type double, (2-2^-52)x2^1023
- smallest positive normal value of type double, 2-1022
- smallest positive nonzero value of type double, 2 p-1074
JSON format: Number
Serialization format: using '.' as the decimal separator.
<integer value>.<integer value>

Boolean value written lowercase: true or false
JSON format: Boolean

Represents a date time without a time zone, viewed as year-month-day-hour-minute-second-millisecond.
It does not store or represent a time zone.
Instead, it is a description of the date, as used for birthdays, combined with the local time as seen on a wall clock.
It cannot represent an instant on the time-line without additional information such as an offset or time zone.
Serialization format: ISO-8601 extended offset date-time format.
It uses DateTimeFormatter.
ISO_LOCAL_DATE_TIME to deserialize and serialize the value.
Learn more .
toDateTimeOnly("<dateTimeOnly in ISO-8601 format>")
Date time constant that also considers time zone.
It represents a date-time with an offset from UTC. It can be viewed as an instant in time with the additional information of the offset.
It is a way to represent a specific “moment” at a certain place of the world.
JSON format: String.
It must be encapsulated in a toDateTime function.
Serialization format: ISO-8601 extended offset date-time format.
It uses DateTimeFormatter.ISO_OFFSET_DATE_TIME to deserialize and serialize the value.
Learn more .
You can also pass an integer passing an epoch value.
Read more .
Time zone can be specified by an offset or a time zone code (example: Europe/Paris, Z - meaning UTC).
toDateTime("<dateTime in ISO-8601 format>")
toDateTime(<integer value of an epoch in milliseconds>)










It represents a time-based amount of time, such as '34.5 seconds'.
It models a quantity or amount of time in terms of milliseconds.
The supported temporal units are: milliseconds, seconds, minutes, hours, days where a day equals to 24 hours.
Years and months are not supported since they're not a fixed amount of time.
JSON format: String. It must be encapsulated in a toDuration function.
Serialization format: To deserialize a time zone ID, it uses the java function java.time.
Duration.parse: the formats accepted are based on the ISO-8601 duration format PnDTnHnMn.nS with days considered to be exactly 24 hours.
Learn more .
toDuration("<duration in ISO-8601 format>")
toDuration(<duration in milliseconds>)
toDuration("PT5S") // 5 seconds

toDuration(500) // 



-- parses as "20.345 seconds"


 -- parses as "15 minutes"

(where a minute is 60 seconds)


-- parses as "10 hours"

(where an hour is 3600 seconds)


-- parses as "2 days"

(where a day is 

24 hours or 86400 seconds)


-- parses as

"2 days, 3 hours and 4 minutes"


-- parses as

"-6 hours and +3 minutes"


-- parses as

"-6 hours and -3 minutes"


-- parses as

"+6 hours and -3 minutes"

list Comma separated list of expressions using square brackets as delimiters. Polymorphism is not supported, hence all the expressions contained in the list should have the same type. [<expression>, <expression>, ... ]