I have a String as DateTime like this 2019-05-21 00:00:00.000
.
This is the code that I use in Dataweave 2 to transform String to DateTime:
SourceDate: payload.Source_date as DateTime {format: "yyyy-MM-dd'T'HH:mm:ss.SSSZ"}
But it returns this error:
"Cannot coerce String (2019-05-21 00:00:00.000) to DateTime, caused by: Text '2019-05-21 00:00:00.000' could not be parsed at index 10
I need to use 'T' and Z to use the TimeZone automatically.
What could be the problem?