美文网首页
C#日期字符串转DateTime

C#日期字符串转DateTime

作者: 我自由吗 | 来源:发表于2022-03-02 08:52 被阅读0次

    string str_date = "Thu Jan 15 15:32:09 +0800 2022";

    string str_date_pattern = "ddd MMM dd HH:mm:ss zzz yyyy";  //分别对应上面的格式

    DateTime dt = DateTime.ParseExact(str_date, str_date_pattern, new System.Globalization.CultureInfo("en-GB"));

    相关文章

      网友评论

          本文标题:C#日期字符串转DateTime

          本文链接:https://www.haomeiwen.com/subject/vudsrrtx.html