Handling WCF Deserialization of DateTime objects

后端 未结 1 1159
Happy的楠姐
Happy的楠姐 2020-12-11 05:52

We\'ve got a scheduling application running that calls a WCF service to run nightly jobs. A large number of these include information about the current business date. For

1条回答
  •  感情败类
    2020-12-11 06:23

    If I understand the problem correctly, you could solve this in post processing by simply using DateTime.ToUniversalTime() on the service side. For your example this should get you a DateTime with the value "2008-11-03 00:00:00" and Kind=DateTimeKind.Utc. Now if you need this same value, but as Local or Unspecified, you could use DateTime.SpecifyKind(DateTime, DateTimeKind) to set the Kind without changing the value.

    0 讨论(0)
提交回复
热议问题