I have an application that will read data from SQL and send it through WCF to the client application in a similar way:
SqlDataAdapter da = new SqlDataAdapter( cmd )
DataSet ds = new DataSet();
da.Fill( ds );
return ds;
All date / time is stored in the database in UTC format. I noticed that if the clock on the computer on which the application is running is distorted, the date / time received by the clients will be distorted. It seems that if the DateTime type is unspecified, WCF will present it as local time inside and send it as such, so any time difference between the application and the client will result in a date / time shift.
I could, of course, go through the datasets as they are restored and fix the date / time fields, but would anyone think of a better way to populate the dataset, so that each DateTime field will be automatically DateTimeKind.Utc on da.Fill ()?
source
share