I am performing a CSV to CSV transformation using DataWeave.
One of the Input fields is a string 13/01/2015. My requirement is to convert this string to a date format as 13-Jan-2015.
I have tried using as :string{"dd/MMM/yyyy} and as :date{format:dd/M/yyyy} functions but did not succeed in changing the format.
Here is what I tried:
payload map {
"Order Number":$[0],
"Order Date": ($[1] as :date{format:"d/M/yyyy"}),
}
This conversion gave the output as
Order Number,Order Date
14710655,2015-08-17
Then I tried the following:
payload map {
"Order Number":$[0],
"Order Date": ($[1] as :date{format:"d/M/yyyy"}) as :string{format:"d/MMM/yyyy"})
}
This conversion gave the output as
Order Number,Order Date
14710655,17/8/2015
13/Jan/2015as expected, what mule version are you using? - Shoki