aman jain
aman jain

Reputation: 63

Parsing time to Datetime with Timezone

I have a time like this:

Fri Dec 04 14:51:22 CST 2020

I want to parse it as Timestamp with Timezone in Python, I am not able to achieve this with regular methods. Could someone please help me in doing this efficiently.

Upvotes: 0

Views: 50

Answers (1)

bafrullaci
bafrullaci

Reputation: 51

Use the parse function from the dateparser package.

from dateparser import parse
dt = parse("Fri Dec 04 14:51:22 CST 2020")

Upvotes: 1

Related Questions