Passing date type variable in post request body

Hi,

I’m trying to start a process by submitting a form. the form contains a variable of type date, I have tried multiple formats in the json object but for some reason camunda fails to convert the value I pass to java.utils.Date object.

{“variables”:
{ …



“date” : {“value” : “2018-10-10”, “type” : “Date”}
},
“businessKey” : “2017”
}

the error I get is:
Cannot convert value ‘2018-10-10’ of type ‘Date’ to java type java.util.Date"

I have also tried this format “2018-10-10T13:33:42” but It doesn’t convert the variable
Cannot convert value ‘2018-10-10T13:33:42’ of type ‘Date’ to java type java.util.Date"

what format should I pass?

1 Like

Hey @hassank,

What version are you using? Since 7.8 there’s a new date format for the Rest API. You can read about it here.

Cheers,
Nikola

I’m using 7.8. Is there any way to change the format?

Yes, you can see how here.

2 Likes

thanks. this solves it.