-1

I am getting the date as below

2022-10-25 11:00:00

which I need to convert to

2022-10-25T11:00:00

Please let me know the appropriate data weave to achieve the above output.

subhash
  • 19
  • 11
  • Does this answer your question? [Add an alphanumeric character in a timestamp](https://stackoverflow.com/questions/74213065/add-an-alphanumeric-character-in-a-timestamp). The same format that you need is described in that answer. – aled Nov 10 '22 at 02:03

2 Answers2

0

@subhash,

you can try adding the letter "T" to the input string and then convert the whole string into DateTime as shown below.

*%dw 2.0 output application/json

(payload replace " " with "T") as DateTime*

Jyoti
  • 1
  • 1
0
%dw 2.0
output application/json
var data = "2022-10-25 11:00:00"
---
data replace  " " with "T"