I am attempting to convert this datetime string from this format:
'Wed, 09 Aug 2017 20:16:59 +0000'
To this format:
'08092017'
I am using dataweave. Here is my code:
order-date:payload.order.date_created
as :localdatetime {format: "E, dd M yyyy hh:mm:ss Z"}
as :string {format: "MMddyyyy"},
I still get the error - Cannot coerce a :string to a :localdatetime, caused by :Text 'Wed, 09 Aug 2017 20:16:59 +0000' could not be parsed at index 8
index 8 appears to the time zone offset, but according to java docs the timezone is specified as uppercase Z
Aug. This seems to agree with the solution in the answer. - Ole V.V.