Convert UTC DateTime to DateTimeOffset
Here is the solution you are looking for: const string dateString = “2012-11-20T00:00:00Z”; TimeZoneInfo timezone = TimeZoneInfo.FindSystemTimeZoneById(“W. Europe Standard Time”); //this timezone has an offset of +01:00:00 on this date DateTimeOffset utc = DateTimeOffset.Parse(dateString); DateTimeOffset result = TimeZoneInfo.ConvertTime(utc, timezone); Assert.AreEqual(result.Offset, new TimeSpan(1, 0, 0)); //the correct utc offset, in this case +01:00:00 Assert.AreEqual(result.UtcDateTime, new DateTime(2012, … Read more