I need to produce a timestamp within my workflow corresponding to the current instant in ISO 8601 format:
2025-04-05T11:59:43+00:00
The Camunda 8 implementation of FEEL provides the now() function for this purpose, however based on all of the documentation I can find, it will always be formatted as a zoned date time string:
now()
"2025-04-05T12:08:08.32801833@Etc/UTC"
My aim is to convert the output of now() natively in FEEL to produce a value/string in a format that is in the standard ISO8601 offset-date-time format, and is parseable by the standard java implementation of OffsetDateTime.parse() .
Alternatives I have considered:
- Converting the string output of now() manually:
replace(string(now()), "@GMT", "Z")
This is very much a bandaid solution, and will obviously not work if the timezone would change for any reason.
- Creating the correctly formatted date-time string in a dedicated job worker - would work but a lot of unnecessary overhead.
I would appreciate any tips on how I could make this conversion work, or if it is not possible in a reasonable way, to extend FEEL to allow for creating now() in different formats.