Reputation: 105
I tried expression like below in mule dataweave but I am getting error.
pdate : "2017-06-22T12:45:55" as:datetime{format : "yyyy-Mm-dd'T'hh:mm:ss"} as :string{format: "MM/DD/yyyy"}
Can you please help on this if I missed anything to write.
Upvotes: 1
Views: 1668
Reputation: 2694
try this:
%dw 1.0
%output application/json
---
{
pdate: "2017-06-22T12:45:55" as :localdatetime { format: "yyyy-MM-dd'T'HH:mm:ss" } as :string { format: "MM/dd/yyyy" }
}
changes compared to your version:
Mm
with MM
in first format string, thx @Daihh
with HH
in first format stringDD
with 'dd' in second format stringUpvotes: 1