mule esb 中的时间戳转换
TimeStamp Convertion in mule esb
我需要在 yyyy-MM-dd format
中捕获文件的最后修改日期。
我试过 #[message.inboundProperties.timestamp]
但得到的时间戳像 142565954
.
是的,我知道可以使用 goovy 或 java 来完成。
有人可以建议使用 mule 表达式语言将时间戳 142565954
转换为 yyyy-MM-dd
格式吗?
请参考以下link:
https://docs.mulesoft.com/mule-user-guide/v/3.6/mule-expression-language-date-and-time-functions
尝试这样的事情:
#[new org.mule.el.datetime.DateTime(new Date(message.inboundProperties.timestamp),"E MMM dd HH:mm:ss z yyyy")]
该时间戳 (message.inboundProperties.timestamp) 是消息时间戳,而不是文件时间戳。
试试这个,它对我有用 server.dateTime
#[message.inboundProperties.timestamp.format('yyyy-MM-dd')]
如果您在 dataweave 中使用,请写为 message.inboundProperties.timestamp as :date {format : "yyyy-MM-dd"}
我需要在 yyyy-MM-dd format
中捕获文件的最后修改日期。
我试过 #[message.inboundProperties.timestamp]
但得到的时间戳像 142565954
.
是的,我知道可以使用 goovy 或 java 来完成。
有人可以建议使用 mule 表达式语言将时间戳 142565954
转换为 yyyy-MM-dd
格式吗?
请参考以下link: https://docs.mulesoft.com/mule-user-guide/v/3.6/mule-expression-language-date-and-time-functions
尝试这样的事情:
#[new org.mule.el.datetime.DateTime(new Date(message.inboundProperties.timestamp),"E MMM dd HH:mm:ss z yyyy")]
该时间戳 (message.inboundProperties.timestamp) 是消息时间戳,而不是文件时间戳。
试试这个,它对我有用 server.dateTime
#[message.inboundProperties.timestamp.format('yyyy-MM-dd')]
如果您在 dataweave 中使用,请写为 message.inboundProperties.timestamp as :date {format : "yyyy-MM-dd"}