How to split string of dates and convert into UTC dates using linq
<p>I have comma separated string containing date and want to convert it in UTC.</p>

<p>I wrote this code: </p>

<pre><code>daterange1.Select(t =&gt; t.Split(',').Select(r =&gt; r.Replace(r, TimeZoneInfo.ConvertTimeToUtc(DateTime.Parse(r), selectedTimeZone).ToString())));
</code></pre>

<p>but it just convert first element and not all the elements.</p>

<p>Any suggestions? </p>

<p><strong>EDIT</strong></p>

<pre><code>daterange = "2016-02-15 17:30:00,2016-02-15 18:00:00;2016-02-16 17:30:00,2016-02-16 18:00:00";

var daterange1 = dateRange.Split(';');

daterange1.Select(t =&gt; t.Split(',').Select(r =&gt; r.Replace(r, TimeZoneInfo.ConvertTimeToUtc(DateTime.Parse(r), selectedTimeZone).ToString())));
</code></pre>

<p>each comma separated string contain startdate and enddate.</p>