title: Converting from CEST /CET date string to UTC date string when CEST timezone not installed on the machine
body: <p>I need to parse some dates that are in CEST/CET, coming as strings from an external provider, and convert them to UTC.</p>
  
  <p>My current culture on my computer is en-GB and I have the BST timezone installed on my machine, but I do not have CEST. Therefore I cannot use <code>TimeZoneInfo</code> to convert between time zones as I cannot instantiate the one for CEST. </p>
  
  <p>How do I do this in C#? I have looked at similar questions here on StackOverflow and googled this but I cannot find a solution that works. </p>
  
  <p>My code currently works with this, but I think it's a hack, still: </p>
  
  <pre><code>// dateToParse: "2018-09-04T19:17:37.022363"
  
  var theDate = DateTime.ParseExact(dateToParse,
      @"yyyy-MM-ddTHH\:mm\:ss\.ffffff",
      new CultureInfo("sq-AL"),       // this culture info is in CEST. Tried using CultureInfo.InvariantCulture as well - nothing changed 
      DateTimeStyles.AssumeLocal);    // tried putting here DateTimeStyles.None
  
  // Our local time is in BST. 
  // CEST and BST are always one hour apart so parsing date during daylight saving times will (probably) still work. 
  // I think. Except for that 1h window when the switch happens...
  theDate = theDate.AddHours(-1);  // I was hoping to not need this!
  var utcDate = theDate.ToUniversalTime(); 
  
  return utcDate;
  </code></pre>
  
  <p>So essentially I am looking for something that understands that the date is in CEST, or CET depending on the time of the year, and not in my current BST time, and knows how to turn that into UTC, factoring in things like daylight saving times. </p>
  
  <p>I don't mind using a library - I have very very briefly looked at NodaTime but didn't find an obvious solution there (there very well might be but I didn't put in the time to reliably look for it). </p>
  
  <p>Any help greatly appreciated.   </p>
  
  <hr>
  
  <p>After help from the comments and searching a bit more, this code seems to work well:</p>
  
  <pre><code>var theDate = DateTime.ParseExact(dateToParse,
      @"yyyy-MM-ddTHH\:mm\:ss\.ffffff",
      CultureInfo.InvariantCulture,
      DateTimeStyles.None);
  
  var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("W. Europe Standard Time");
  var utcDate = TimeZoneInfo.ConvertTimeToUtc(theDate, timeZoneInfo);
  
  return utcDate;
  </code></pre>