import maya
If you want to convert a string type to a datetime type, the common way is to use strptime(date_string, format). But it is quite inconvenient to to specify the structure of your datetime string, such as ' %Y-%m-%d %H:%M:%S'.There is a tool that helps you convert the string to datetime automatically called maya. You just need to parse the string and maya will figure out the structure of your string.
#automatically pass date time strings
string = '21-09-2020 11:17:35.423562+00:00'
maya.parse(string).datetime()
datetime.datetime(2020, 9, 21, 11, 17, 35, 423562, tzinfo=<UTC>)
if you want to convert the string to a different time zone (for example, EST), you can parse that into maya's datetime function
#Converting timezone from UTC TO EST
maya.parse(string).datetime(to_timezone = 'EST')
datetime.datetime(2020, 9, 21, 6, 17, 35, 423562, tzinfo=<StaticTzInfo 'EST'>)