How to get regional timezone on Compact Framework and then convert UTC date to local date?
views:
102answers:
2
A:
P/Invoke GetTimeZoneInformation to get the current timezone biases, then use those to offset the UTC time.
Alternately you could use the DateTimeHelper.GetTimezoneInformation call in the SDF.
ctacke
2010-02-15 22:45:05
+2
A:
The DateTime.ToLocalTime() method is available on CF, no need to jump through hoops. Do make sure to use a DateTime constructor that takes a DateTimeKind argument so you can tell it that it's a UTC time, if necessary.
Hans Passant
2010-02-15 22:51:43