Seeing that the task cannot be archived using the WP7 / Silverlight environment, I wrote a small helper that does the job:
public static class DateTimeHelper {
The trick was to analyze without the DateTimeStyles.AssumeUniversal flag (this means that TryParseExact assumes the date is UTC and returns the date converted / adjusted to local), defining it as UTC and then manually setting it to the actual UTC are equivalent.
This follows the DST rules that can be found here . I tested it with all 4 boundary cases just before / after the start / end of daylight saving time. This again showed the importance of testing: I had to change the < operator in DstStart.CompareTo(result) < 0 to <= to give the correct result.
I had the feeling that I was inventing the wheel here (which I do not like to do), but did not want to use a special library for this simple work. I looked at Noda Time, which is a great project, but I think it is not necessary for this.
Hope I can save a little on this little helper. This is intentionally not common to all time zones (if you need it, use lib, such as Noda Time), but for those cases when you have only one fixed single time zone, as in my case.
source share