简体   繁体   English

ule esb中的时间戳转换

[英]TimeStamp Convertion in mule esb

I need to capture file last modified date in yyyy-MM-dd format . 我需要以yyyy-MM-dd format捕获文件的最后修改日期。

I tried #[message.inboundProperties.timestamp] but getting timestamp like 142565954 . 我尝试#[message.inboundProperties.timestamp]但得到的时间戳像142565954

Yes, I know it can be done using goovy or java. 是的,我知道可以使用goovy或java来完成。

Please can anybody suggest to convert the timestamp 142565954 to yyyy-MM-dd format with mule expression language? 请有人建议使用m子表达语言将时间戳142565954转换为yyyy-MM-dd格式吗?

Please reference the below link: https://docs.mulesoft.com/mule-user-guide/v/3.6/mule-expression-language-date-and-time-functions 请参考以下链接: https : //docs.mulesoft.com/mule-user-guide/v/3.6/mule-expression-language-date-and-time-functions

Try something like this : 尝试这样的事情:

#[new org.mule.el.datetime.DateTime(new Date(message.inboundProperties.timestamp),"E MMM dd HH:mm:ss z yyyy")] 

试试这个,它与我server.dateTime

#[message.inboundProperties.timestamp.format('yyyy-MM-dd')]

该时间戳(message.inboundProperties.timestamp)是消息时间戳,而不是文件时间戳。

如果您在dataweave中使用,则请写成message.inboundProperties.timestamp::date {format:“ yyyy-MM-dd”}

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

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