阅读背景:

如何将DateTimeKind.Unspecified类型的DateTime转换为C#(.NET)中的DateTime.Kind.Utc

来源:互联网 

I've inherited C# code that has an awful lot of DateTimes where the Kind property is DateTimeKind.Unspecified. These are fed into Datetime.ToUniversalTime() which gives back a UTC datetime (it adds 7 hours in my case). This is how ToUniversalTime() works; see MSDN. The problem is that these DateTimes are in fact already in UTC time. They are pulled out of a SQL Server Compact 4.0 database. They were stored there in UTC. My main question is:I've inherited C# code that has an awful lot of




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: