Python convert timestamp with offset into actual local time for MySQL INSERT
How do I convert a timestamp in Python, such as
2020-05-28 02:00:00+02:00 into
2020-05-28 04:00:00, where the offset
+02:00 was added to show the right local time at
I have tried the following code for conversion:
>>> datetime.strptime('2020-05-28 02:00:00+02:00', '%Y-%m-%d %H:%M:%S%z').strftime('%Y-%m-%d %H:%M:%S')
But how could I display the latter result showing the actual local day and time? The converted timestamp will then be added into a MySQL database.