如何查找当前日期和数据编织的时间?

时间:2016-05-06 11:16:57

标签: datetime dataweave

我正在使用dataweave将XML文件转换为CSV文件,我想要当前的日期和时间。有效载荷的时间。那么,如何获得它?

2 个答案:

答案 0 :(得分:1)

使用now 例如。 ProgramLastDate : now 或者可以使用`

[server.dateTime.format(' yyyyMMddHHmmssSSSSs&#39)]`

答案 1 :(得分:0)

您可以使用"ProgramLastDate" : now as :string {format: "yyyy-MM-dd"}获取系统日期和时间,但根据您的代码,我认为您希望从xml元素Current_Effective_Time获取日期时间。如果您在“yyyy-MM-dd HH:mm:ss.SSS”格式中收到Current_Effective_Time,则可以使用

ProgramLastDate : payload.ns0#Worker_Sync.ns0#Header.ns0#Current_Effective_Time  as :datetime {format:"yyyy-MM-dd HH:mm:ss.SSS"} as :string {format:"dd-MM-yyyy"}

希望这有帮助。

相关问题