将系统日期转换为时间戳格式



我想从sysdate向第三方服务器传递时间戳。以下是假设作为时间日期发送所需的格式。

2022-09-23T15:38:47.6927242-05:00

我已经尝试使用下面的时间戳

select systimestamp from dual

当我把这个传给有效载荷时,我得到了低于错误

The server encountered an error processing the request. Please see the <a rel="help-page" href="https://ws.aramex.net/ShippingAPI.V2/Shipping/Service_1_0.svc/Xml/help">service help page</a> for constructing valid requests to the service. The exception message is 'The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://ws.aramex.net/ShippingAPI/v1/:Shipments. The InnerException message was 'There was an error deserializing the object of type System.Collections.Generic.List`1[[Corp.ShippingAPI.FrontEnd.Contracts.Shipment, Corp.ShippingAPI.FrontEnd.Contracts, Version=1.287.0.0, Culture=neutral, PublicKeyToken=null]]. The value '' cannot be parsed as the type 'DateTime'.'.  Please see InnerException for more details.'. See server logs for more details. The exception stack trace is: </p>
<p>   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContext

如果必须传递这样的格式,则SYSTIMESTAMP函数返回的format值。

例如:

SQL> select to_char(systimestamp,'yyyy-mm-dd"T"hh24:mi:ss:ff7TZR') val from dual;
VAL
-------------------------------------------------------------
2022-09-23T13:15:53:7027320+02:00
SQL>

最新更新