How to convert this time format 'Fri Apr 01 2022 00:01:00 GMT+0100' to UTC/GMT

Viewed 36

I'm converting this time format Fri Apr 01 2022 00:01:00 GMT+0100 like this

date_parser = lambda x: datetime.strptime(x, "%a, %d %b %Y %H:%M:%S %Z")
ch = pd.read_excel(
    r'ACEOM2022-04_2022-07.xlsx',
    skiprows=[1],
    dtype{'datetime':str},
    parse_dates=["datetime"],
    date_parser=date_parser
)

But I would like to convert this datetime Fri Apr 01 2022 00:01:00 GMT+0100 into the same above format. I have one more dataframe which is in UTC format. I would like to have all the dataframes to be in UTC itself.

How can I do it in python so that all the data is in a same format? Please do provide your response.

0 Answers
Related