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"));
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
网友评论