I have a pandas dataframe with a string column representing a date/time. The date column can have various different timezone endings such as BST, UTC, +01 etc. I don't know a priori which endings each date may have. I've only shown three for illustration purposes.
data = {'Name': ['Bob', 'Mary','Alice'],
'Age': [21, 19, 20],
'Date': ['2022-07-07 16:43 (+01)', '2022-07-07 16:43 (UTC)',
'2022-07-07 16:43 (BST)']}
# Convert the dictionary into DataFrame
data = pd.DataFrame(data, columns=['Name', 'Age',
'Date'])
Dataframe:
Name Age Date
Bob 21 2022-07-07 16:43 (+01)
Mary 19 2022-07-07 16:43 (UTC)
Alice 20 2022-07-07 16:43 (BST)
Does a general method exist to remove the various suffixes from the date and convert it to a standard timezone (let's say UTC)?