我來自智利是和時區當前設置爲GMT -3:00。我的平臺配置了這些時區設置:日期時間從SOAP的WebLogic服務轉變爲WCF應用
Oracle數據庫:GMT -3:00
的WebLogic服務器:GMT -3:00
Windows 7客戶端:GMT -3:00
第一次查詢:日期= 26
執行此查詢時,我得到了奇怪的結果/ 03/08 06:10:00,000000000
第二查詢:日期= 24/05/13 18:48:00,000000000
我可以看到(通過SOAP UI)在WebLogic返回此結果:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:fobpgGestacionesPorFichaResponse xmlns:ns2="http://nucleo.alemana.cl/">
<fobpgGestacionesPorFichaResult>
<gestaciones>
<controles>7</controles>
<esGestaTerminada>1</esGestaTerminada>
<fechaPrimerControl>2007-10-05T00:00:00-03:00</fechaPrimerControl>
<fechaTermino>2008-03-26T06:10:00-03:00</fechaTermino>
..............^ date #1 is here
<fur>2007-08-05T00:00:00-03:00</fur>
<furOp>2007-08-05T00:00:00-03:00</furOp>
<gesdaFechaCreacion>2015-08-19T14:58:41.903-03:00</gesdaFechaCreacion>
<gesnuIdGesta>45087</gesnuIdGesta>
<gesnuNroGesta>1</gesnuNroGesta>
<rnMayorPeso>0</rnMayorPeso>
</gestaciones>
<gestaciones>
<controles>12</controles>
<esGestaTerminada>1</esGestaTerminada>
<fechaPrimerControl>2012-10-11T00:00:00-03:00</fechaPrimerControl>
<fechaTermino>2013-05-24T18:48:00-03:00</fechaTermino>
..............^ date #2 is here
<fur>2012-08-27T00:00:00-03:00</fur>
<furOp>2012-08-27T00:00:00-03:00</furOp>
<gesdaFechaCreacion>2015-08-19T14:58:28.071-03:00</gesdaFechaCreacion>
<gesnuIdGesta>45086</gesnuIdGesta>
<gesnuNroGesta>2</gesnuNroGesta>
<rnMayorPeso>1980</rnMayorPeso>
</gestaciones>
</fobpgGestacionesPorFichaResult>
</ns2:fobpgGestacionesPorFichaResponse>
</S:Body>
</S:Envelope>
然而,當我的客戶WPF應用程序連接到WebLogic服務,並獲取上述數據,我得到這些值(在調試模式):
1日起反應
這是什麼,我期望(6:10)提前一小時(7:10)。
第二日響應
這是預期(18:48)!
我不知道是怎麼回事。爲什麼這些結果不一致?
嗨F.Rojas,我編輯你的問題,清理語法和格式。如果您覺得我改變了問題的含義,請隨時回滾。歡迎來到堆棧溢出! –
SOAP響應看起來正確。你可以反序列化爲'DateTimeOffset'而不是'DateTime'並檢查它認爲它有哪些時區數據? –
我在ServiceReference setter中更改了System.DateTime對於System.DateTimeOffset。所有日期的返回數據如下: 01-01-0001 0:00:00 +00:00 –