Date format Dataweave solution for string variable
date : ("17545443526000" as :number / 1000) as :datetime as :string {format:"yyyy/dd/MM"}
Date format Dataweave solution for a number variable
date : (17545443526000/ 1000) as :datetime as :string {format:"yyyy/dd/MM"}
Quick tip:
How to convert a date (string) format to "yyyy-MM-dd" format
%dw 2.0
output application/json
var date='24-03-2020'
---
date as Date {format: 'dd-MM-yyyy'} as String {format: 'yyyy-MM-dd'}
This article covers Dataweave 2.0 and Dataweave 1.0 code to convert date in desired formats Ex: "yyyy-MM-dd". Its a simple and most effective way to convert the date format in JSON/XML messages
0 Comments