title: c# parse string (without timezone) to DateTime, taking DST into account
body: <p>I've read many SO articles, but I don't seem to be able to find a good answer to the problem. Posted suggestions include functions that convert dates to and from strings more then once, concatenating bits on the end and it all just seems... messy</p>
  
  <p>So to the problem:</p>
  
  <p>We have servers around the world. All servers run in their own local time and keep logs with time entries that are local to the server. Some servers are in DST observing areas, others arent</p>
  
  <p>Suppose I have these strings from a log: <em>2013-01-01 12:34:56,  2013-07-01 12:34:56</em>
  And I know that this server is in New York so it's UTC-5 or UTC-4 when DST is in operation</p>
  
  <p>And I have the same strings from a log on a server in Hong Kong, where DST does not apply and the time zone is +8</p>
  
  <p>What I'm after is a block of code where I can tell it:</p>
  
  <ul>
  <li>Here is a string representing a time  </li>
  <li>Here is the timezone the string is from </li>
  <li>Daylight Savings should apply if relevant</li>
  </ul>
  
  <p>And the code will parse the string into a DateTimeOffset, where the offset is adjusted according to DST if the time being parsed is DST relevant</p>
  
  <p>For example:
  NY server log says "<em>2013-01-01</em> ..." DST <strong>does NOT</strong> apply to this date in JANUARY so the date parsed should be:
  12:34:56 in new york time, a.k.a 17:34:56 in UTC (because it's -5, no DST)</p>
  
  <p>NY server log says "<em>2013-07-01</em> ..." DST <strong>DOES</strong> apply to this date in june so the date parsed should be:
  12:34:56 in new york time, a.k.a 16:34:56 in UTC (because it's -4, with the DST)</p>
  
  <p>HK server, both date times parse to 04:34:56 UTC</p>
  
  <p>Thanks guys</p>