covert timezone info into datetime
<p>how do i convert the following datetime string that contains a timezone designation into a datetime type?</p>

<p>here's the string "2011-11-27 23:59:59 EST"</p>

<p>here's what i've found on msdn:</p>

<pre><code>class Program
{
    static void Main(string[] args)
    {
        // I realize here that the types don't match but just trying to
        // illustrate what i'm trying to do
        DateTime myDate = ReturnTimeOnServer("2011-11-27 23:59:59 EST");
    }

    public static DateTimeOffset ReturnTimeOnServer(string clientString)
    {
        string format = @"yyyy-mm-dd h:m:s zzz";
        TimeSpan serverOffset = TimeZoneInfo.Local.GetUtcOffset(DateTimeOffset.Now);

        try
        {
            DateTimeOffset clientTime = DateTimeOffset.ParseExact(clientString, format, CultureInfo.InvariantCulture);
            DateTimeOffset serverTime = clientTime.ToOffset(serverOffset);
            return serverTime;
        }
        catch (FormatException)
        {
            return DateTimeOffset.MinValue;
        }
    }
}
</code></pre>
