How to format date time in Dataweave now() function Mulesoft

The syntax for converting date format in Dataweave 2.0


How to format dates in Dataweave 2.0 as String in Mule? How to use now() function in Dataweave and convert into desired date and time format in Mule Dataweave using Transform message component
%dw 2.0
output application/java
---

now() as String {format: "yyyy-MM-dd_HH_mm_ss"}


%dw 2.0
output application/java
---
now() as String {format: "MM/dd/yyyy hh:mm:ss a"} // For am or pm format

How to convert milliseconds to date format using dataweave?


Reference to a few more example of Date format using Dataweave






Post a Comment

0 Comments