I am trying to convert the following string '1.12.22 14:16UTC+01:00' in Pandas to December 1st 2022
my_date = '1.12.22 14:16UTC+01:00'
new_date = pd.to_datetime(my_date)
Timestamp('2022-01-12 14:16:00-0100', tz='pytz.FixedOffset(-60)')
It inverts month with day only in specific cases. I am trying to use format="%d.%m.%Y %H:%M%z" but it says that the string is not matching the format.
time data '1.12.22 14:16UTC+01:00' does not match format '%d.%m.%Y %H:%M%z' (match)
Thanks for your help.
%zdoesn't work as you expect.