Convert string to time with python [duplicate]
问题 This question already has answers here : Parsing date/time string with timezone abbreviated name in Python? (5 answers) Closed 6 years ago . I have read a few stackoverflow posts but still can't figure this out... I want to crawl craigslist post posted within last 48 hours. Posted time is in the following format for craigslist: 2013-03-15, 7:43PM MDT I have tried string = "2013-03-15, 7:43PM MDT" time.strptime(string, "%Y-%m-%d, %I:%M%p %Z") But apparent the format doesnt match the string.