title: Get ZoneId using country name, datetime and timezone offset values in c#
body: <p>I have datetime(yyyy-MM-ddTHH:mm:ss), timezone offset value (K i.e -/+HH:mm) and country name and want to fetch IANA format ZoneId from these values in my web API.</p>
  
  <p>Eg : </p>
  
  <pre><code>public static string FetchZoneID(string dateTime, string offset, string countryName)
  {        
  //fetch zoneID    
  return zoneId;
  }
  </code></pre>
  
  <p>for values</p>
  
  <pre><code>dateTime = "2020-02-06T06:11:01", offset = "+13:00", countryName = "New Zealand"
  </code></pre>
  
  <p>I should get </p>
  
  <pre><code>zoneId = "Pacific/Auckland"
  </code></pre>
  
  <p>and for values</p>
  
  <pre><code>dateTime = "2020-05-06T06:11:01", offset = "+12:00", countryName = "New Zealand"
  </code></pre>
  
  <p>I should get (due to DST)</p>
  
  <pre><code>zoneId = "Pacific/Auckland"
  </code></pre>
  
  <p>Currently using NodaTime, I was able to fetch all zoneIds for a particular country, but unable to figure out on how to filter these based on datetime and offset values.</p>
  
  <pre><code>var zoneIds = TzdbDateTimeZoneSource.Default.ZoneLocations.Where(x =&gt; x.CountryName == countryName)
      .Select(x =&gt; x.ZoneId);
  </code></pre>
  
  <p>Can someone help me on this?</p>
  
  <p>Note: In case of multiple zoneIds being eligible for the given offset, the first value would be used.</p>