Converting the date given from Apple receipts to a .net DateTime object
<p>Although it's probably something simple - I couldn't find any place that gives any (correct) solution for it...</p>
<p>Apple receipts return dates in RFC 3339
It looks like that:</p>
<blockquote>
<p>2016-08-10 19:47:16 America/Los_Angeles</p>
<p>2016-08-11 02:42:16 Etc/GMT</p>
</blockquote>
<p>Any solution I found does not handle the timezone correctly...
for example:
DateTime object doesn' seem to have a string converter for this format at all.</p>
<p>Another solution I found:</p>
<pre><code>string tTranDatStr = &quot;2016-08-11 02:42:16 Etc/GMT&quot;;
trans_date = XmlConvert.ToDateTime(tTranDatStr, XmlDateTimeSerializationMode.Local);
</code></pre>
<p>But it throws:</p>
<blockquote>
<p>The string '2016-08-11 02:42:16 Etc/GMT' is not a valid AllXsd value.</p>
</blockquote>
<p>Is there any elegant solution that is also correct (converts the time to the current locale timezone...)?</p>
<p>THANKS!!</p>