DateTime.ParseExact format string

后端 未结 3 1766
清酒与你
清酒与你 2020-12-21 13:32

I have a web application that passes a DateTime from one page to another through the query string. It was working just fine in both IE and FireFox, but was throwing excepti

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-21 14:02

    I tried running the code

    static void Main(string[] args) {
        Console.WriteLine(DateTime.Now.ToString("ffffd MMM dd yyyy HH:mm:ss zzz"));            
        Console.Read();
    }
    

    Output is :

    Mon Oct 01 2012 10:52:20 -04:00

    So I guess you need to parse the GMT and (Eastern Daylight Time) part of strings as well

提交回复
热议问题