-1

We have a requirement wherein we have to convert the date obtained in number format to String format using data weave 2.0.

Below is the snippet of input date that we receive, want to perform transformations on that value.

enter image description here

Manvitha
  • 21
  • 3
  • 1
    You have to describe it in more detail. A screenshot like this is not useful. Use text. The following information should be in your question: a) the input data (the number) example and description. Is it an Unix epoch? what does represent the number. b) The expected output format. You show us several fields that are not relevant (apparently). The field "date" is not a number, not a string. – aled May 28 '20 at 15:54

1 Answers1

0

Example what you provided has invalid JSON. All string values should be in double quotes. Here is example how you can produce valid JSON from the date value.

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

https://simpleflatservice.com/mule4/Date_format.html

Format works in both ways - to produce string value from date or parse string value to a date. But, in both cases string in the JSON should be in quotes.

Alex
  • 4,457
  • 2
  • 20
  • 59