<p>I'm on .NET 2.0, running under Medium Trust (so <a href="http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx" rel="nofollow noreferrer">TimeZoneInfo</a> and the Registry are not allowed options).  I'm asking the user for two dates and a time zone, and would really love to be able to automatically determine whether I need to adjust the time zone for DST.  </p>

<p>This probably isn't even a valid scenario unless I have some <em>very</em> robust support, a la <a href="http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx" rel="nofollow noreferrer">TimeZoneInfo</a>, to differentiate between all of the different varieties of Time Zones in the first place.</p>

[{'answer_id': 44819, 'author': 'Domenic', 'author_id': 3191, 'author_profile': 'https://Stackoverflow.com/users/3191', 'pm_score': 0, 'selected': False, 'text': "<p>Well, since <code>TimeZoneInfo</code> is excluded, you're probably not going to find a solution in the framework itself (but don't quote me on that).</p>\n\n<p>In which case, have you considered reflectoring the <code>TimeZoneInfo</code> class and using what you find there?</p>\n"}, {'answer_id': 44826, 'author': 'bdukes', 'author_id': 2688, 'author_profile': 'https://Stackoverflow.com/users/2688', 'pm_score': 0, 'selected': False, 'text': '<p>@<a href="https://stackoverflow.com/questions/44795/how-can-i-determine-whether-a-given-date-is-in-daylight-saving-time-for-a-given#44819">Domenic</a>, I\'ve considered, but I\'d prefer to stay legal, and I\'m fairly sure the information would have to be embedded into the framework anyway, or grabbed from the registry in some sneaky way that doesn\'t require permissions...</p>\n'}, {'answer_id': 44863, 'author': 'Eric Z Beard', 'author_id': 1219, 'author_profile': 'https://Stackoverflow.com/users/1219', 'pm_score': 3, 'selected': True, 'text': '<p>In .NET 2.0 you have to code this yourself.  It involves researching daylight savings time laws in various regions and building that into your own data structures.  The problem is somewhat simplified if you only care about a subset of time zones, for example just in the USA, but if you need all global time zones, you have a lot of work to do, and then the code has to be updated every few years when the laws change.  Even the new time zone objects in the latest version of .NET will require windows updates to keep them correct as laws change.</p>\n\n<p>Look <a href="http://aa.usno.navy.mil/faq/docs/daylight_time.php" rel="nofollow noreferrer">here</a>, <a href="http://en.wikipedia.org/wiki/Daylight_saving_time" rel="nofollow noreferrer">here</a>, and <a href="http://www.timeanddate.com/time/aboutdst.html" rel="nofollow noreferrer">here</a> for more info.</p>\n'}, {'answer_id': 157980, 'author': 'Daryl', 'author_id': 24158, 'author_profile': 'https://Stackoverflow.com/users/24158', 'pm_score': 2, 'selected': False, 'text': '<p>The <a href="http://www.twinsun.com/tz/tz-link.htm" rel="nofollow noreferrer">TZ Database</a> is a public domain database of timezone rules that is very well maintained.  There is also a compiled format for the data they provide, and there are lots of libraries available to read the compiled data, like this one: <a href="http://www.codeproject.com/KB/locale/zoneinfo_dotnet_api.aspx" rel="nofollow noreferrer">ZoneInfo (tz database / Olson database) .NET API</a></p>\n'}, {'answer_id': 158006, 'author': 'Chris Shaffer', 'author_id': 6744, 'author_profile': 'https://Stackoverflow.com/users/6744', 'pm_score': 2, 'selected': False, 'text': '<p>Excellent timezone library here: <a href="http://www.babiej.demon.nl/Tz4Net/main.htm" rel="nofollow noreferrer">TZ4Net</a></p>\n'}]
['https://Stackoverflow.com/questions/44795', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2688/']