开发者

How to convert a string containing a EDT related instant to a DateTime?

开发者 https://www.devze.com 2023-02-17 14:58 出处:网络
I have 开发者_如何学Pythona string in this format: \"Fri, 18 Mar 2011 18:53:15 EDT\" I want to convert this to datetime object, the problem is with EDT, at the end. If I use GMT DateTime.TryParse wo

I have 开发者_如何学Pythona string in this format:

"Fri, 18 Mar 2011 18:53:15 EDT"

I want to convert this to datetime object, the problem is with EDT, at the end. If I use GMT DateTime.TryParse works fine, but if it is something else like EDT, it return false.


Check out the TimeZoneInfo class and this question, or the definitive time zone guide.

0

精彩评论

暂无评论...
验证码 换一张
取 消