简体   繁体   中英

TimeStamp Convertion in mule esb

I need to capture file last modified date in yyyy-MM-dd format .

I tried #[message.inboundProperties.timestamp] but getting timestamp like 142565954 .

Yes, I know it can be done using goovy or java.

Please can anybody suggest to convert the timestamp 142565954 to yyyy-MM-dd format with mule expression language?

Please reference the below link: 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”}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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