Help! Formatting timezone for a timestamp field on a Camunda form

Looking for some help. I have a user facing Camunda Form that has a timestamp field on it. I’m in Australia and want it to be formatted in my local timezone.

Environment: Camunda Platform 7.16 (self-hosted on AWS)
Modeler: 5.0.0

Current state:

  • Process with a user task with input variable of “timestamp”, with expression ${now().toString()}
  • User task invokes the Camunda Form, which has the key = “timestamp”

Problem:

  • When input variable expression is $now(), then it outputs the full default ISO string e.g. 2022-06-24T09:02:19
  • This works fine, but is not user friendly to present on a report
  • $now().toString() is better, but in the wrong timezone e.g. Thu Jun 23 22:58:59 UTC 2022

I’ve looked at the Camunda documentation on Internal Context Functions and it talks about now(), and dateTime() being Joda Time, and supporting all the Joda stuff. I’ve spent a LOT of time on Google and got nowhere in transforming the ISO string output into my local tz. I’ve tried all sorts of things and just keep getting deploy errors or method not found errors e.g. ${dateTime(DateTimeZone(“Australia/Melbourne”))}, ${dateTime().forId(“Australia/Melbourne”).toString()} and a million different variations of this and ${now()}

As you can see I’m a non-coder and unfamiliar with Java, classes, methods and JUEL expressions!

Can someone please tell me what expression I need so that I get a nicely formatted current timestamp in my local timezone, and get it to display in a Camunda Form?! I just can’t figure this one out.

Also, happy to be told of different ways of doing this, but I’m somewhat limited to doing this as an expression.

Thanks in advance!