Best practices for DateTime serialization in .NET 3.5

前端 未结 6 1765
执念已碎
执念已碎 2020-12-01 10:45

Some 4 years back, I followed this MSDN article for DateTime usage best practices for building a .Net client on .Net 1.1 and ASMX web services (with SQL 2000 server as the b

6条回答
  •  遥遥无期
    2020-12-01 11:34

    UTC/GMT would be consistent in distributed environment.

    One important thing is that specify the datetimeKind after populating your DateTime property with the value from database.

    dateTimeValueUtcKind = DateTime.SpecifyKind(dateTimeValue, DateTimeKind.Utc);
    

    See MSDN

提交回复
热议问题