Мне нужно преобразовать этот формат даты в Mule 3.2 YYYY-MM-DDThh:mm:ss.sTZD (iso8601), например, 1997-07-16T19:20:30.45+ 01:00
Я использую #[function:datestamp:YYYY-MM-DDThh:mm:ss.sTZD], но это не работает
Мне нужно преобразовать этот формат даты в Mule 3.2 YYYY-MM-DDThh:mm:ss.sTZD (iso8601), например, 1997-07-16T19:20:30.45+ 01:00
Я использую #[function:datestamp:YYYY-MM-DDThh:mm:ss.sTZD], но это не работает
Ответ на самом деле таков (мой предыдущий ответ был неправильным):
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<http:connector name="HTTP_HTTPS" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" doc:name="HTTP-HTTPS"/>
<flow name="dateFlow">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8089" path="serverdate" connector-ref="HTTP_HTTPS" doc:name="HTTP"/>
<logger message="#[server]" level="INFO" doc:name="Logger"/>
<set-payload value="#[new java.text.SimpleDateFormat("yyyy-MM-DD'T'hh:mm:ss.SSSZ").format(new java.util.Date())]" doc:name="Set Payload"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>
</mule>