简体   繁体   English

Mule 中的日期转换

[英]Date conversion in Mule

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.请让我知道实现上述 output 的适当数据编织。

@subhash, @subhash,

you can try adding the letter "T" to the input string and then convert the whole string into DateTime as shown below.您可以尝试将字母“T”添加到输入字符串中,然后将整个字符串转换为 DateTime,如下所示。

*%dw 2.0 output application/json *%dw 2.0 output 应用程序/json

(payload replace " " with "T") as DateTime* (有效负载将“”替换为“T”)作为 DateTime*

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM