I appreciate that this question has been covered many times over in various forms, but none seem to help with the particular problem that I'm experiencing. I have the following method that I use to convert incoming data to a C# DateTime variable. The trouble is, the company sending the data in are claiming that I'm converting it incorrectly because the times are appearing one hour behind in my system. I would assume that this is something to do with British Summertime, but is the problem at my end, or at their end, because I thought the method below would be taking account of British Summertime by the fact I'm using ToLocalTime? Any help would be gratefully accepted.
private DateTime ConvertTimeStamp(double t)
{
return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)
.AddMilliseconds(t)
.ToLocalTime();
}
tvalue, it is hard to be super helpful alas.ToLocal? Basically you need to determine if they are sending the date in UTC to begin with or not. If they will not provide the numbers maybe you can add some logging?